package com.phoenix.wistariz.base.consts;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import com.ebiz.framework.util.validate.FormatUtil;
public class EmdConst {
private static Properties prop;
public static String EMD_IP = null;
public static int EMD_PORT = 0;
public static String EMD_APPNAME = null;
public static String EMD_OFFICE = null;
public static String EMD_CUSTOMNO = null;
public static String EMD_VALIDATIONNO = null;
public static String MU_AIR=null;
public static String MU_CHANNEL=null;
public static String MU_OFFICECODE=null;
public static String MU_IATANO=null;
static{
if(null==prop){
initEmdProperties();
}
}
public static void initEmdProperties(){
prop=new Properties();
try {
InputStream inp=EmdConst.class.getResourceAsStream("/emdclient.properties");
prop.load(inp);
inp.close();
} catch (IOException e) {
//如果发生IO异常,返回
return;
}
EmdConst.EMD_IP=prop.getProperty("server.ip");
EmdConst.EMD_PORT=FormatUtil.toInt(prop.getProperty("server.port"));
EmdConst.EMD_APPNAME=prop.getProperty("client.app");
EmdConst.EMD_OFFICE=prop.getProperty("client.office");
EmdConst.EMD_CUSTOMNO=prop.getProperty("client.customno");
EmdConst.EMD_VALIDATIONNO=prop.getProperty("client.validationno");
EmdConst.MU_AIR=prop.getProperty("mu.airline");
EmdConst.MU_CHANNEL=prop.getProperty("mu.channel");
EmdConst.MU_OFFICECODE=prop.getProperty("mu.officeno");
EmdConst.MU_IATANO=prop.getProperty("mu.iatano");
}
}
资源文件Properties:
server.ip=172.25.5.2
server.port=8091
client.app=muairb2cetd1
client.office=sha777
client.customno=0
client.validationno=2
mu.airline=MU
mu.channel=B2C
mu.officeno=SHA777
mu.iatano=08690450