上面comments是描述信息
这里有一个代码,是项目中用来获取配置文件中的数值的
/**
* 获取配置文件值
*
* @param proFileName
* 配置文件路径
* @param key
* 键
* @return 值
*/
public static String getPropertyValue(String proFileName, String key) {
String fileName = RuntimeEnv.getInstance().getNCHome() + File.separator
+ "resources" + File.separator + proFileName;// 取得属性文件的路径
FileInputStream input = null;
try {
input = new FileInputStream(fileName);
Properties properties = new Properties();
properties.load(input);
String content = properties.getProperty(key);
if (content != "" && null != content)
return new String(content.getBytes("ISO-8859-1"), "UTF-8");
else
return "";
} catch (IOException e) {
return "";
}finally{
try {
if(input!=null)
input.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}