📅  最后修改于: 2022-03-11 14:52:47.259000             🧑  作者: Mango
public class ConfigurationReader {
private static Properties properties;
static {
try (FileInputStream fileInputStream = new FileInputStream("configuration.properties")) {
properties = new Properties();
properties.load(fileInputStream);
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException("Unable to find configuration.properties file!");
}
}
public static String getProperty(String key) {
return properties.getProperty(key);