获取ApplicationResources.properties配置文件的值

/*
* 从配置ApplicationResources.properties获取文件jfDsFtpGtgsPath存取路径
*/
public String getApplicationResourcesByKey(String properties,String key){
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(properties);
Properties props = new Properties();
try {
props.load(inputStream);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String vl=props.getProperty(key);

return vl;
}

 

posted @ 2011-11-02 11:55  方坚.cn  阅读(522)  评论(0编辑  收藏  举报