Write configuration in project development is written in the properties file, but sometimes you need to change the value, but find that you need to restart the service to take effect
/**
* Initialization profile *
/public
void init () {
try{inputstream is
= Config.class.getResourceAsStream ("/ Res/config.properties ");
Properties = new properties ();
Properties.load (IS);
} catch (Exception e) {
throw new RuntimeException ("Failed to get Properties!");
}
It was later found that this load method would load the config.properties file into memory and fetch the file information directly from memory the next time it needed to read, rather than read it again.
So you need to change the way the input stream gets to the file.
String path = Config.class.getClassLoader (). GetResource ("/res/config.properties"). GetPath ();
InputStream is = new FileInputStream (path);
Properties.load (IS);