• Post Reply Bookmark Topic Watch Topic
  • New Topic

Get the property without restarting the server  RSS feed

 
kri shan
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to get the property from properties file without restarting the server (without using WatcherService).

FileInputStream fis = new FileInputStream("/a/b/test.properties");
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kri shan wrote:How to get the property from properties file without restarting the server (without using WatcherService).

FileInputStream fis = new FileInputStream("/a/b/test.properties");


https://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#load%28java.io.InputStream%29
 
kri shan
Ranch Hand
Posts: 1489
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kri shan wrote:https://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#load%28java.io.InputStream%29

This one needs server restart.


I don't think so, of course you have to reload manually in your code:



should reload myProps from file and replace the old values in myProps with the new values coming from the file.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!