Java Load Properties example

来源:互联网 发布:淘宝5元话费红包 编辑:程序博客网 时间:2024/06/09 19:51

http://www.mkyong.com/java/java-properties-file-examples/

public static Map<String, String> getProperties(){
Map<String, String> properties = new HashMap<String, String>();
try {
prop.load(new FileInputStream("src/main/java/config.properties"));
properties.put("OrganizationCustomFieldTwitter", prop.getProperty("OrganizationCustomFieldTwitter"));
properties.put("ClassNameValue", prop.getProperty("ClassNameValue"));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return properties;
}

原创粉丝点击