PropertiesUtil
程序员文章站
2022-04-25 14:29:31
...
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class PropertiesUtil {
private static Properties prop = new Properties();
public static void readProperties(String filename){
try {
InputStream in = PropertiesUtil.class.getClassLoader().getResourceAsStream(filename);
prop.load(in);
} catch (IOException e) {
e.printStackTrace();
}
}
public static String getProperty(String key){
return prop.getProperty(key);
}
}
上一篇: springproperties注入
下一篇: 如何让某些用户对Marketing Cloud的contact数据只能实施只读操作 Marketing CloudreadonlyAuthenticationAuthorization权限控制
推荐阅读