Answers for "configuration reader java"

0

configuration reader java

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);
Posted by: Guest on May-30-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language