0ab17b73124ff3459fb08e43c49c79fb35c3c222.svn-base 847 B

123456789101112131415161718192021222324252627282930313233343536
  1. package com.cockpit.util;
  2. import java.io.IOException;
  3. import java.io.InputStream;
  4. import java.util.Properties;
  5. /**
  6. * 得到webserviceProperty属性文件工具类
  7. * @author zhumingyue
  8. *
  9. */
  10. public class ConfigManager{
  11. private static ConfigManager configManager ;
  12. private static Properties properties ;
  13. private ConfigManager(){
  14. String configFile = "webserviceProperty.properties" ;
  15. properties = new Properties() ;
  16. InputStream is = ConfigManager.class.getClassLoader().getResourceAsStream(configFile);
  17. try{
  18. properties.load(is) ;
  19. is.close() ;
  20. } catch (IOException e){ e.printStackTrace(); }
  21. }
  22. public static ConfigManager getInstance(){
  23. if(configManager == null){
  24. configManager = new ConfigManager() ;
  25. }
  26. return configManager ;
  27. }
  28. public String getProper(String key){
  29. return properties.getProperty(key);
  30. }
  31. }