dcsimg
Modifying the properties of property file within a jar file.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sridhar_Sripathy
Posted On:   Wednesday, May 14, 2003 02:20 PM

Hello,
I have myapp.properties file in a jar file myprops.jar. I know how to read the contents
of the property file from the jar file in my application, but I would like to know how I could
modify individual properties within the property file that is in the jar file.
Can files in the jar file be directly written to without extracting, modifying
and compressing them back?
Thanks in advance.
SS

Re: Modifying the properties of property file within a jar file.

Posted By:   Stephen_Ostermiller  
Posted On:   Thursday, May 15, 2003 02:01 PM

Modifying files in the jar file is usually not the way to go. Most programs use a properties file that is in the jar file but they save any changes to a properties file that is in the user's directory. That way one installation of the program can be used by several users. To load the properties, load the ones from the jar file and then load the ones from the user directory over riding any from the jar file. To save them, save them to the user directory.
About | Sitemap | Contact