zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package cn.autoform.util;
 
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
 
public class ConfigManager {
    private static ConfigManager configManager;
    private Properties property;
    private  ConfigManager(){
        try(InputStream in = ConfigManager.class.getClassLoader().getResourceAsStream("application.properties")){
            property = new Properties();
            property.load(in);
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
 
    }
    public static  ConfigManager getInstance(){
        if(configManager == null){
            configManager = new ConfigManager();
        }
        return configManager;
    }
    public String getString(String key){
        return property.getProperty(key);
    }
 
}