This week's book giveaway is in the
We're giving away four copies of a choice of
"Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac"
and have Joe Kissell on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Take Control of Upgrading to Yosemite
Take Control of Automating Your Mac
this week in the
Java in General
Modifying Property Files.
Joined: May 15, 2005
Sep 23, 2008 02:37:00
Can property file be modified programatically?
SCJP 1.4, SCWCD 1.4, SCBCD 1.5
Joined: Apr 10, 2008
Sep 23, 2008 02:47:00
Well a Property file is just a text file after all. Just as you can read from a property file so can you write to a property file.
You can always modify a file using the
Joined: May 31, 2007
Sep 23, 2008 02:53:00
But once you programmatically modify it, need to reload the data to your memory (e.g. Properties) for those changes to take effect or need to restart the application.
Java Interview Questions and Answers Blog
Java Interview Books
Joined: Aug 05, 2008
Sep 23, 2008 04:47:00
Yes you can use the Properties class to load and store a property file.
look at the load and store methods of this class. The properties class is basically a Hashtable and you can put and remove elements from it.
The only problem might be that you will lose any comments already in the property file. I believe the Jakarta Commons project has an implementation that supports comments.
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: Modifying Property Files.
jsp:setProperty stand action and its body
Dynamically moving the DIV
jquery datepicker not working
Table mapping problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014