Questions tagged [apache-commons-config]

The Commons Configuration software library provides a generic configuration interface which enables a Java application to read configuration data from a variety of sources.

The Apache Commons Configuration software library provides a generic configuration interface which enables a Java application to read configuration data from a variety of sources. Commons Configuration provides typed access to single, and multi-valued configuration parameters as demonstrated by the following code:

Double double = config.getDouble("number");
Integer integer = config.getInteger("number");

Configuration parameters may be loaded from the following sources:

  • Properties files
  • XML documents
  • Windows INI files
  • Property list files (plist)
  • JNDI
  • JDBC Datasource
  • System properties
  • Applet parameters
  • Servlet parameters

Different configuration sources can be mixed using a ConfigurationFactory and a CompositeConfiguration. Additional sources of configuration parameters can be created by using custom configuration objects. This customization can be achieved by extending AbstractConfiguration or AbstractFileConfiguration.

Official Website: http://commons.apache.org/configuration/

Useful Links:

146 questions
1
vote
2 answers

Apache Commons Configuration trigger event on property file change

I'm using Apache Commons Configuration library to store my app properties. I can monitor changes of property file using FileChangedReloadingStrategy and it works perfectly. What I would like to do is to trigger configurationChanged event of…
Sorantis
  • 14,496
  • 5
  • 31
  • 37
1
vote
1 answer

Change an apache.commons.configuration file into a pythonable configparser file

The aim is to change an org.apache.commons.configuration file into a pythonable configparser file I have a Java Apache config file as such (the full file is http://pastebin.com/Wz2T2KV9): ############################## # BABELNET-RELATED…
alvas
  • 115,346
  • 109
  • 446
  • 738
1
vote
1 answer

Python equivalence to org.apache.commons.configuration?

I want to port this Configuration.class object (from http://pastebin.com/dZeV27XB) into python and it seems hard to port the org.apache.commons.configuration object In the java class, there were multiple functions that returns a…
alvas
  • 115,346
  • 109
  • 446
  • 738
1
vote
1 answer

How to load property file located inside jar file

How to load property files placed in resource folder of an executable jar file. Here my app itself is a jar and it executes on it own. It need to find this property file (placed within itself under resource folder) at runtime depending on the path…
1CzDx
  • 57
  • 1
  • 2
  • 8
1
vote
2 answers

Commons Config - How to delete a node?

I have an xml configuration file built using commons config (XMLConfiguration) Google
www.google.com
Yahoo
www.yahoo.com
Steve Kallestad
  • 3,484
  • 2
  • 23
  • 31
1
vote
1 answer

Given a Configuration object, how can I create a PropertiesConfiguration object?

I have a method that returns a Configuration object. I need to instantiate a PropertiesConfig object to save this to disk. How can I do so?
rjurney
  • 4,824
  • 5
  • 41
  • 62
1
vote
0 answers

Apache Commons-Config - ClearTree() leaves whitespace in document

This is probably a silly one, but when using the clearTree() function on a HierarchicalConfiguration node it leaves the newline in after each property. Note they are the single line kind like
James DeRagon
  • 364
  • 1
  • 4
  • 11
1
vote
1 answer

Why the code doesn't change .properties file

I have the following code which must add new values to the existing properties in the .properties file of, if the property doesn't exist - create it. public String saveProperties(ArrayList properties, String customerId){ final…
Nikitin Mikhail
  • 2,983
  • 9
  • 42
  • 67
1
vote
1 answer

Extended Properties for Spring Framework

Looking for a solution that will provide us more functionality within Spring properties such as: nested structures maps/lists properties referencing other properties. Example: city.name=Toronto city.address=#{city.name}, 123 Ave SW I tried…
partizan
  • 469
  • 1
  • 9
  • 22
1
vote
0 answers

Replacing Default Configuration Iterpolator with Custom

I have been trying to register a custom configuration interpolator in the commons configuration that would take care of some fallback values by default. Here is the code for interpolator. public class FallbackConfigurationInterpolator extends…
mbellani
  • 31
  • 2
1
vote
1 answer

Loading updated properties automatically from multiple properties files

My requirement is to update the configurations of my application automatically when a change is made to a properties file. For maintaining the properties, I am using PropertiesConfiguration from Apache Commons Configuration project.(Using…
Vivek Nandavanam
  • 1,805
  • 2
  • 13
  • 13
1
vote
1 answer

Trouble integrating a library using Apache Commons Config with Spring project using PropertyPlaceholderConfigurer

I have a custom library that sends a JMS notification. The idea is that you can use the library by simply by setting some properties in your project. The custom library is using the Apache Commons Configuration. (The reason I mention this is that I…
rschlachter
  • 720
  • 1
  • 9
  • 20
0
votes
1 answer

Reference to file for PropertiesConfiguration with Spring

My application is running on Jboss 4.2.2 GA with Spring 2.5.6, Richfaces 3.1.6.SR1, JSF 1.1_02. What I want is to have a porpertie file outside my ear which will contain s.th. like…
AlfonsSocken
  • 68
  • 2
  • 10
0
votes
1 answer

How to read a list from a YAMLConfigutation

I have a YAML file that looks like this: foo: bar: - entry1: 1 entry2: a - entry1: 2 entry2: b (Where the actual list is much longer.) I'm reading this file using Apache Configuration2's YAMLConfiguration. I can see the data…
marinier
  • 387
  • 3
  • 13
0
votes
1 answer

PropertiesConfiguration doesn't reload with Symbolic link

Considering the scenario where 'file' is a symbolic link to a real one file -> real_file if I configure PropertiesConfiguration (from Apache Commons Config) to open the symbolic link it doens't reload it if I update the real file String filePath =…
Alessio Fiore
  • 467
  • 1
  • 7
  • 18