public class PropertyMgr {
static Properties props = new Properties();
static {
try {
props.load(PropertyMgr.class.getClassLoader().getResourceAsStream("config"));
} catch (IOException e) {
e.printStackTrace();
}
}
public static Object get(String key) {
if (props == null) {
return null;
}
return props.get(key);
}
}
手写获取配置文件中的值
最新推荐文章于 2024-07-22 14:15:06 发布