
package com.ardikars.simsekolah.util;

import java.io.IOException;
import java.io.InputStream;

public class Properties {

    private static InputStream is = null;

    private static java.util.Properties properties = new java.util.Properties();

    public static String getStringProperties(String fname, String key) {
        is = is.getClass().getClassLoader().getResourceAsStream(fname);
        try {
            properties.load(is);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return properties.getProperty(key);
    }

    public static int getIntegerProperties(String fname, String key) {
        is = is.getClass().getClassLoader().getResourceAsStream(fname);
        try {
            properties.load(is);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return Integer.parseInt(properties.getProperty(key));
    }
}