日志框架实现实时修改,实时生效,具体框架思路(6)
2015-06-23 11:47
281 查看
代码接第(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;
}
}
/**
* 读取资源信息 <功能详细描述>
*
* @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;
}
}
相关文章推荐
- 控制器基类
- 为什么项目屡屡延期 - 占空比对工期的显著影响
- Oracle之序列
- Oracle之序列
- 第十五周oj刷题——Problem K: C++习题 复数类--重载运算符+,-,*,/
- unix高级编程时遇到apue.h找不到的问题
- iOS开发- 文件共享(利用iTunes导入文件, 并且显示已有文件)
- uva 11090 Going in Cycle!! (求平均权值最小的环路)
- 面试成功的五条最重要原则!
- openwrt linux python 服务器程序的后台运行
- 原创炫酷代码公开——连接董铂然github
- Exchange Server 2010邮件撤回条件说明
- 操作系统安装教程之图解Ubuntu Server 14.04安装
- 日志框架实现实时修改,实时生效,具体框架思路(5)
- C++中cout和cerr的区别?
- Servlet深入学习
- java技术加强之其他1.5特性
- Android五天乐(第一天)开发环境的部署,开发流程与调试
- c 处理基于java服务端byte[]数组接收图片( xsd__base64Binary)
- PHP是什么?