public class TjfxPropertyUtility {
private static Properties property = null;
private static void newInstance() throws Throwable{
File file = new File(TjfxPropertyUtility.class.getResource("/config/tjfx.properties").toURI());
if(file.exists()) {
property = new Properties();
property.load(new FileInputStream(file));
} else {
throw new Exception("tjfx.properties not setup");
}
}
public static String getProperty(String key) {
if(property==null) {
try {
newInstance();
} catch (Throwable e) {
e.printStackTrace();
}
}
return property.getProperty(key);
}
}