File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Properties file dynamic value Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Properties file dynamic value" Watch "Properties file dynamic value" New topic
Author

Properties file dynamic value

Adam Teg
Ranch Hand

Joined: Jul 10, 2007
Posts: 58
I have a properties file. I want to add dynamic value. Example

101=Error 'DYNAMIC VALUE' stoping application.

How can I do this with in Java?

Thanks
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12269
    
    1
A properties file is just a bunch of text lines - each containing a name and a value.

How the program interprets the value is up to the programmer. Properties files are usually read just once - when the program starts - if you want different behaviour you will have to program it.

Bill


Java Resources at www.wbrogden.com
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Are you looking to replace the text DYNAMIC VALUE with a message you make up at runtime? Look at the MessageFormat doc. In recent JREs also look at PrintStream and PrintWriter printf() methods.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Properties file dynamic value
 
Similar Threads
adding dynamic value to properties file.
Configuration files - Best Practice?
Junit problem, how to load a properties file
Generating dynamic log file with dynamic file name
Dynamic Field Validation