Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Properties file

 
Sasha McGrath
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is a bit confusing..

I hope it's only me..
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic