//读取配置文件
static{
FileInputStream in = null;
try {
Properties properties = new Properties();
// phoneUtil.class.getResourceAsStream("/phone.properties") 获取resources下的配置文件
properties.load(phoneUtil.class.getResourceAsStream("/phone.properties"));
ACCESS_KRY_id = properties.getProperty("accessKeyId");
ACCESS_KEY_SECRET = properties.getProperty("accessKeySecret");
SIGN_NAME =properties.getProperty("SignName");
TEMPLATE_CODE = properties.getProperty("TemplateCode");
} catch (Exception e) {
e.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}