• Post Reply Bookmark Topic Watch Topic
  • New Topic

Apache's Commons-Configuration  RSS feed

 
Sagar Kar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What Commons-Configuration does is reads in a few properties or xml files and makes us available some convenience methods to read the values.
For e.g if there is a string property "test" then its value can be retrived by the method getString("test").
There is also a method called setProperty(key,value) that takes in a key and its new value.
My Question is :-
Is there a way to store the changed configuration back to the files from where the initial values were read?

thanks,
Sagar
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like FileConfiguration has some methods to save the current configuration to file:
http://jakarta.apache.org/commons/configuration/apidocs/org/apache/commons/configuration/FileConfiguration.html
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!