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;
    }

}

最新文章

  1. visio个人专注
  2. 【BZOJ1012】 【JSOI2008】最大数maxnumber
  3. 【开源】EFW框架系列文章索引
  4. ActiveReports 9 新功能:借助目录(TOC)控件为报表添加目录功能
  5. 【C#】【MySQL】C# 查询数据库语句@Row:=@Row+1
  6. CDN学习笔记二(技术详解)
  7. QLabel
  8. html 知识
  9. gsoap创建webservice服务简单教程
  10. PyTorch(二)Intermediate
  11. python第三十一天-----类的封装、继承,多态.....
  12. C#面向对象基础2
  13. Android系统移植与驱动开发
  14. rsa 公钥 私钥
  15. elk----es settings--logstash--performance---bigdesk---logstash plugin online/offline
  16. CentOS7 安装 PostGIS方法(适合国内网络)
  17. ulipad python相关设置
  18. 使用python对文件中的数值进行累加
  19. CSS 选择器 :last-child与:last-of-type的区别
  20. 安装java运行环境

热门文章

  1. Pascal “熊猫烧香”(骗人的)
  2. gulp批量添加版本号
  3. Pythonyield使用浅析
  4. Oracle 遇到的问题:IMP-00041: 警告: 创建的对象带有编译警告解决办法
  5. 【PTA】Tree Traversals Again
  6. 编译caffe遇到的问题
  7. CentOS下创建和root权限完全相同用户
  8. maven学习(十八)——用Nexus搭建Maven私服
  9. pytorch:EDSR 生成训练数据的方法
  10. jQuery对象转化为DOM对象