a0bd148e73726826b2998ce3290d1108eaedd5e9.svn-base 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package xin.glue.ui.common.component;
  2. import java.util.Properties;
  3. import com.posdata.glue.util.PosFileResourceUtil;
  4. public class PosSiteConfig {
  5. private static PosSiteConfig config = new PosSiteConfig();
  6. private boolean debug = false;
  7. private boolean beta = false;
  8. private boolean writeLog = true;
  9. private boolean L2_debug = false;
  10. private boolean TC_detail = false;
  11. private boolean TC_debug = false;
  12. private int TC_port;
  13. public PosSiteConfig() {
  14. try {
  15. Properties props = new Properties();
  16. props.load(PosFileResourceUtil.getResourceAsStream("/siteConfig.properties"));
  17. this.debug = "Y".equals(props.get("site.config.debug"));
  18. this.beta = "Y".equals(props.get("site.config.beta"));
  19. this.writeLog = "Y".equals(props.get("site.config.writeLog"));
  20. this.L2_debug = "Y".equals(props.get("L2.debug"));
  21. this.TC_detail = "Y".equals(props.get("TC.detail"));
  22. this.TC_debug = "Y".equals(props.get("TC.debug"));
  23. this.TC_port = Integer.parseInt((String)props.get("TC.port"));
  24. } catch (Exception e) {
  25. e.printStackTrace();
  26. }
  27. }
  28. public static boolean isDebug() {
  29. return config.debug;
  30. }
  31. public static boolean isBeta() {
  32. return config.beta;
  33. }
  34. public static boolean isWriteLog() {
  35. return config.writeLog;
  36. }
  37. public static boolean isL2_debug() {
  38. return config.L2_debug;
  39. }
  40. public static boolean isTC_detail() {
  41. return config.TC_detail;
  42. }
  43. public static boolean isTC_debug() {
  44. return config.TC_debug;
  45. }
  46. public static int getTC_port() {
  47. return config.TC_port;
  48. }
  49. }