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