DiaowenProperty.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package com.key.common.utils;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. import java.util.Properties;
  5. import org.apache.struts2.ServletActionContext;
  6. import org.springframework.beans.BeansException;
  7. import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
  8. import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
  9. import com.baidu.ueditor.ConfigManager;
  10. import com.sun.org.apache.xml.internal.security.Init;
  11. /**
  12. *
  13. * @author keyuan
  14. *
  15. */
  16. public class DiaowenProperty extends
  17. PropertyPlaceholderConfigurer {
  18. public static String DWSTORAGETYPE = null;
  19. public static String ACCESS_KEY_ID = null;
  20. public static String SECRET_ACCESS_KEY = null;
  21. public static String ENDPOINT = null;
  22. public static String STORAGE_URL_PREFIX = null;
  23. public static String WENJUANHTML_BACKET = null;
  24. public static String UPLOADFILE_BACKET = null;
  25. public static String UPLOADFILE_JM_BACKET = null;
  26. // private static Map<String, String> ctxPropertiesMap;
  27. @Override
  28. protected void processProperties(
  29. ConfigurableListableBeanFactory beanFactoryToProcess,
  30. Properties props) throws BeansException {
  31. super.processProperties(beanFactoryToProcess, props);
  32. DWSTORAGETYPE = props.getProperty("dw.storage.type");
  33. ACCESS_KEY_ID = props.getProperty("dw.yunos.access_keyid");
  34. SECRET_ACCESS_KEY = props.getProperty("dw.yunos.access_keysecret");
  35. ENDPOINT = props.getProperty("dw.yunos.endpoint");
  36. // FILE_BACKET_DOMAIN = props.getProperty("dw.yunos.file_backet_domain");
  37. STORAGE_URL_PREFIX = props.getProperty("dw.storage.url_prefix");
  38. WENJUANHTML_BACKET = props.getProperty("dw.yunos.wenjuan_html_backet");
  39. UPLOADFILE_BACKET = props.getProperty("dw.yunos.upload_file_backet");
  40. UPLOADFILE_JM_BACKET = props.getProperty("dw.yunos.upload_file_jm_backet");
  41. /*
  42. ctxPropertiesMap = new HashMap<String, String>();
  43. for (Object key : props.keySet()) {
  44. String keyStr = key.toString();
  45. String value = props.getProperty(keyStr);
  46. ctxPropertiesMap.put(keyStr, value);
  47. }
  48. */
  49. }
  50. /*
  51. public static String getContextProperty(String name) {
  52. return ctxPropertiesMap.get(name);
  53. }
  54. */
  55. public void diaowenInit(){
  56. System.out.println("系统初始化方法。。。");
  57. System.out.println(ServletActionContext.getContext());
  58. }
  59. }