public static String getEmailInfo(String proname){
String url = "";
InputStream in=null;
try {
Properties prop = new Properties();
in = Thread.currentThread().getContextClassLoader().getResourceAsStream("email.properties");
prop.load(in);
url = prop.getProperty(proname);
} catch (Exception e) {
e.printStackTrace();
throw new ExceptionInInitializerError();
}finally{
if(in!=null)
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return url.trim();
}
最后
以上就是妩媚太阳最近收集整理的关于根据配置文件properties名称获取属性的值的全部内容,更多相关根据配置文件properties名称获取属性内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复