代碼接第(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;
}
}