I have a standard Java application that reads configuration properties at start-up time, which work fine. However, I would like to update the configuration properties at execution time without compiling the code each time. How would I go about doing that.
e.g code:
Properties py = new Properties();
InputStream ins;
String prepName = "config.properties";
ins = getClass().getClassLoader().getResourceAsStream(prepName);
if (ins == null) {
System.err.println("Couldn't find the file!");
return "Error";
}
py.load(ins);
String message = py.getProperty("msg");
resources/config.properties
msg=testMessage
If I want to change message dynamically, how would I do it?