Properties文件工具读取类
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class CommonPropertiesUtil {
private static CommonPropertiesUtil instance;
private CommonPropertiesUtil(){
}
public static synchronized CommonPropertiesUtil getInstance(){
if(instance == null){
instance = new CommonPropertiesUtil();
}
return instance;
}
/**
* 读取配置文件
* @return
*/
public Properties loadUploadProperty() {
Properties prop=new Properties();
InputStream is = null;
try {
is = this.getClass().getResourceAsStream("/uploadConfig.properties");
prop.load(is);
is.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (is != null) {
try {
is.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
return prop;
}
}
最新文章
- visio个人专注
- 【BZOJ1012】 【JSOI2008】最大数maxnumber
- 【开源】EFW框架系列文章索引
- ActiveReports 9 新功能:借助目录(TOC)控件为报表添加目录功能
- 【C#】【MySQL】C# 查询数据库语句@Row:=@Row+1
- CDN学习笔记二(技术详解)
- QLabel
- html 知识
- gsoap创建webservice服务简单教程
- PyTorch(二)Intermediate
- python第三十一天-----类的封装、继承,多态.....
- C#面向对象基础2
- Android系统移植与驱动开发
- rsa 公钥 私钥
- elk----es settings--logstash--performance---bigdesk---logstash plugin online/offline
- CentOS7 安装 PostGIS方法(适合国内网络)
- ulipad python相关设置
- 使用python对文件中的数值进行累加
- CSS 选择器 :last-child与:last-of-type的区别
- 安装java运行环境