/* * Copyright (c) 2017 univento.eu - All rights reserved * You are not allowed to use, distribute or modify this code */ package eu.univento.commons.configuration; import java.io.IOException; import java.io.InputStream; import java.util.Properties; /** * @author joethei * @version 1.0 */ public class ConfigurationHandler { private Properties properties; public ConfigurationHandler() { properties = new Properties(); InputStream in; try { in = getClass().getResourceAsStream("/config.properties"); properties.load(in); in.close(); } catch (IOException e) { e.printStackTrace(); } } private Object getProperty(String key) { return properties.getProperty(key); } public String getString(String key) { return String.valueOf(getProperty(key)); } public int getInteger(String key) { return Integer.valueOf(getString(key)); } }