java文件读取
来源:互联网 发布:触摸交互式软件 编辑:程序博客网 时间:2024/06/08 17:18
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Properties;
import org.apache.log4j.Logger;
public class MgjrProperties {
private static Properties properties = null;
private static Logger logger = Logger.getLogger(MgjrProperties.class);
protected static synchronized Properties getProperties() {
if (properties == null) {
properties = new Properties();
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
properties.load(new InputStreamReader(classLoader.getResourceAsStream("mgjr_param.properties"),"UTF-8"));
} catch (IOException e) {
logger.error("读取mgjr_param.properties失败!", e);
}
}
return properties;
import java.io.InputStreamReader;
import java.util.Properties;
import org.apache.log4j.Logger;
public class MgjrProperties {
private static Properties properties = null;
private static Logger logger = Logger.getLogger(MgjrProperties.class);
protected static synchronized Properties getProperties() {
if (properties == null) {
properties = new Properties();
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
properties.load(new InputStreamReader(classLoader.getResourceAsStream("mgjr_param.properties"),"UTF-8"));
} catch (IOException e) {
logger.error("读取mgjr_param.properties失败!", e);
}
}
return properties;
}
}
阅读全文
0 0
- java读取ini文件
- JAVA读取XML文件
- java读取中文文件
- Java读取文件
- JAVA读取XML文件
- java读取中文文件
- java读取pdf文件
- JAVA读取word文件
- JAVA读取PDF文件
- java读取word文件
- java读取excel文件
- java读取excel 文件
- java 读取文件(中文)
- java读取文件源代码
- java 读取文件
- Java读取Properties文件
- java读取.properties文件
- Java读取文件
- 九度 题目1445:How Many Tables
- StatckOverflowError和OutofMemorryError的区别
- 这个配置决定了每个Input Split 的最小值
- 简介分布式---任意软件变为“分布式”
- Android animation补间动画第二种写法
- java文件读取
- HDU 6198 number number number 题解
- 人脸识别 传统Haar与CNN比较
- 函数式编程初探
- 微信公众帐号开发教程01-引言
- 选择排序
- Java基础总结--Java编程环境变量配置
- SearchView使用笔记
- IT技术培训红火催生“积云速度”