67,514
社区成员
发帖
与我相关
我的任务
分享
try {
FileInputStream fis = new FileInputStream(filePath
+ "/config.properties");
Reader r = new InputStreamReader(fis, "UTF-8");
//................................... 这里报错 ..........................................
props.load(r);
//.......................................................................................
Iterator it = props.keySet().iterator();
while (it.hasNext()) {
String key = (String) it.next();
logger.info("config.properties key:" + key);
configMap.put(key, props.get(key));
}
} catch (Exception ex) {
logger.error(ex.getMessage());
}
java.io.InputStream is = PropertyUtil.class
.getResourceAsStream(propertyFilePath);
if (is == null) {
return loadPropertyFileByFileSystem(propertyFilePath);
}
Properties ppts = new Properties();
try {
ppts.load(is);
return ppts;
} catch (Exception e) {
_log.debug("加载属性文件出错:" + propertyFilePath, e);
return null;
}