package xin.glue.ui.common.component; import java.util.Properties; import com.posdata.glue.util.PosFileResourceUtil; public class PosSiteConfig { private static PosSiteConfig config = new PosSiteConfig(); private boolean debug = false; private boolean beta = false; private boolean writeLog = true; private boolean L2_debug = false; private boolean TC_detail = false; private boolean TC_debug = false; private int TC_port; public PosSiteConfig() { try { Properties props = new Properties(); props.load(PosFileResourceUtil.getResourceAsStream("/siteConfig.properties")); this.debug = "Y".equals(props.get("site.config.debug")); this.beta = "Y".equals(props.get("site.config.beta")); this.writeLog = "Y".equals(props.get("site.config.writeLog")); this.L2_debug = "Y".equals(props.get("L2.debug")); this.TC_detail = "Y".equals(props.get("TC.detail")); this.TC_debug = "Y".equals(props.get("TC.debug")); this.TC_port = Integer.parseInt((String)props.get("TC.port")); } catch (Exception e) { e.printStackTrace(); } } public static boolean isDebug() { return config.debug; } public static boolean isBeta() { return config.beta; } public static boolean isWriteLog() { return config.writeLog; } public static boolean isL2_debug() { return config.L2_debug; } public static boolean isTC_detail() { return config.TC_detail; } public static boolean isTC_debug() { return config.TC_debug; } public static int getTC_port() { return config.TC_port; } }