123456789101112131415161718192021222324252627282930313233343536 |
- package com.cockpit.util;
- import java.io.IOException;
- import java.io.InputStream;
- import java.util.Properties;
- /**
- * 得到webserviceProperty属性文件工具类
- * @author zhumingyue
- *
- */
- public class ConfigManager{
- private static ConfigManager configManager ;
- private static Properties properties ;
- private ConfigManager(){
- String configFile = "webserviceProperty.properties" ;
- properties = new Properties() ;
- InputStream is = ConfigManager.class.getClassLoader().getResourceAsStream(configFile);
- try{
- properties.load(is) ;
- is.close() ;
- } catch (IOException e){ e.printStackTrace(); }
- }
-
- public static ConfigManager getInstance(){
- if(configManager == null){
- configManager = new ConfigManager() ;
- }
- return configManager ;
- }
-
- public String getProper(String key){
- return properties.getProperty(key);
- }
- }
|