加载properties文件
来源:互联网 发布:网络监控结构图 编辑:程序博客网 时间:2024/05/22 01:34
package test;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import org.apache.commons.logging.LogFactory;public class JunitTest { org.apache.commons.logging.Log log = LogFactory.getLog(JunitTest.class); public void testLoadFile(){ FileInputStream fileInputStream = null; try { fileInputStream = new FileInputStream("C:\\config.properties"); java.util.Properties properties = new java.util.Properties(); properties.load(fileInputStream); Object value = properties.get("a"); System.out.println(value.toString()); } catch (FileNotFoundException e) { try { fileInputStream.close(); } catch (IOException e1) { log.error("JunitTest IOException "+e1); } } catch (IOException e) { try { fileInputStream.close(); } catch (IOException e1) { log.error("JunitTest IOException "+e1); } } }}
0 0
- spring 加载 properties文件
- java 加载properties 文件
- java 加载properties 文件
- java加载properties文件
- Java 加载Properties文件
- sping加载.properties文件
- 快速加载properties文件
- 加载properties文件
- spring加载properties文件
- 加载Properties静态文件
- 关于加载properties文件
- JAVA加载properties文件
- 加载properties文件
- .properties文件的加载
- Spring加载properties文件
- Log4j.properties文件的加载
- java 加载解析properties 文件
- j2ee properties文件的加载
- Android使用adb获得activity堆栈信息
- android LayoutInflater.inflate()的参数及其用法
- js增加行
- Lambda 表达式
- 代码块高级
- 加载properties文件
- 那些程序员出身的畅销书作家
- phpstorm配置代码自动同步到服务器
- Unity3D下 仙剑奇侠传三 人物移动及视角控制的尝试实现及补充
- 布局文件的优化
- UIScrollView循环滚动(三张图片循环滚动)
- 新下拉刷新控件:SwipeRefreshLayout
- 当前时间推后两个工作日的时间
- 已迷失在Python的世界里,如此简单,灵活,强大,优美