• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updating Properties file

 
Dinesh Bang
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I want to update the properties file without changing the sequence of key,value pairs.
When I do it using Java.util.Proeprties.setProperty , the format of file is lost, although the data gets persisted.

Is there any way out ?

Thanks in advance
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could extend the Properties with your own class that overrides the "load" and "store" method with versions that remember (load) and honor (store) the order of the original file. If you start with the code of the original methods, that shouldn't be too hard.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic