Configuration Service

This service based on Commons Configuration and gives you access to nearly all features of the Commons Configuration library with one extension: The ConfigurationService resolves the kind of the needed configuration interface by the extension of your file/resource.

The ConfigurationService dont need any contribution.

use cases

here we access a simple properties file "test.properties" located in the application classpath.

                    
Resource configResource = new ClasspathResource("test.properties");
Configuration configuration = configurationService.getConfiguration(configResource);

configuration.getString("test.value1");
configuration.getInt("test.value2");
configuration.getStringArray("test.value3");

                

and here we access a xml file "test.xml" located in the WWW.

                    
Resource configResource = new URIResource("http://www.anywhere.de/test.xml");
Configuration configuration = configurationService.getConfiguration(configResource);

configuration.getString("test.value1");
configuration.getInt("test.value2");
configuration.getStringArray("test.value3");