日誌框架實現實時修改,實時生效,具體框架思路(6)

代碼接第(5)章:

/**
* 讀取資源信息 <功能詳細描述>

* @param filePath
*            資源路徑(包含文件名稱)
* @return Properties [返回類型說明]
* @see [類、類#方法、類#成員]
*/
private Properties readProperties(String filePath) {
Properties props = new Properties();
InputStream in = null;
try {
in = new BufferedInputStream(new FileInputStream(filePath));
props.load(in);
} catch (FileNotFoundException e) {
LOG.error(e.getMessage() + "The config file {0} is not exit");
} catch (IOException e) {
LOG.error(e.getMessage() + "Read config file {0} error");
} finally {
if (null != in) {
try {
in.close();
} catch (IOException e) {
LOG.error(e.getMessage()
+ "Close inputStream of file {0} error ");
}
}
}
return props;
}
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章