- protected Properties load() {
- try {
- Properties prop = new Properties();
- String path = "prop/conf.properties";
- String os = System.getProperty("os.name");
- if (os.toLowerCase().startsWith("win")) {
- path = "/src/prop/conf.properties";
- }
- InputStream in = new FileInputStream(System.getProperty("user.dir") + File.separator + path);
- prop.load(in);//属性文件将该流加入的可被读取的属性中
- return prop;
- } catch (Exception ex) {
- log.error("加载配置文件异常,系统over@@", ex);
- System.exit(0);
- }
- return null;
- }