File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Properties file" Watch "Properties file" New topic
Author

Properties file

Sasha McGrath
Greenhorn

Joined: Jun 01, 2007
Posts: 10
I have a properties file and I have another file where I would like to have a method set a variable that is equal to the variable in the properties file. How would I do that?
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 378
Your question is a bit confusing..

I hope it's only me..
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14432
    
  23

You can load the contents of a properties file with the load() method in class Properties:

Then you can use the Properties object to get and set the values. With the store() method (look it up in the API documentation) you can write the contents of the Properties object back to a file.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
Don't get me started about those stupid light bulbs.
 
subject: Properties file