You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2013/04/30 22:06:16 UTC

[jira] [Commented] (CONFIGURATION-541) Support for Property files in MultiFileHierarchicalConfiguration. Currently only xml files are supported.

    [ https://issues.apache.org/jira/browse/CONFIGURATION-541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13645910#comment-13645910 ] 

Oliver Heger commented on CONFIGURATION-541:
--------------------------------------------

Currently, there is ongoing work on a redesigned and not backwards compatible version 2.0 of Commons Configuration. One change in this version is that configurations are now always created by specific builder objects.

In subversion, there is already a builder implementation for creating multi-file configuration objects. This builder actually supports arbitrary file-based configurations. (With the restriction, that a multi-file configuration object only supports a single type of file-based configurations; so you cannot use a single file-pattern which selects both XML and properties file for different variable substitutions.)

So if I understand correctly, your request is already fulfilled in version 2.0. However, there is still a bunch of work to do until this version can be released.
                
> Support for Property files in MultiFileHierarchicalConfiguration. Currently only xml files are supported.
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-541
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-541
>             Project: Commons Configuration
>          Issue Type: Wish
>          Components: Build
>    Affects Versions: 1.8
>            Reporter: Meraj
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <configuration>
>   <header>
>     <result delimiterParsingDisabled="true" forceReloadCheck="true" loggerName="TestLogger"
>             config-class="org.apache.commons.configuration.DynamicCombinedConfiguration"
>             keyPattern="$$${sys:filename}">
>       <nodeCombiner config-class="org.apache.commons.configuration.tree.MergeCombiner"/>
>     </result>
>     <providers>
>       <provider config-tag="multifile"
>          config-class="org.apache.commons.configuration.DefaultConfigurationBuilder$FileConfigurationProvider"
>          configurationClass="org.apache.commons.configuration.MultiFileHierarchicalConfiguration"/>
>     </providers>
>   </header>
>   <override>
> 	<system />
>     <multifile filePattern="/usr/config/$$$${sys:filename}.xml"
>                config-name="clientConfig1" delimiterParsingDisabled="true" schemaValidation="false">
>        <reloadingStrategy refreshDelay="500"
>           config-class="org.apache.commons.configuration.reloading.FileChangedReloadingStrategy"/>
>     </multifile>
>    <multifile filePattern="/usr/configclient/$$$${sys:filename}.properties"
>                config-name="clientConfig1" delimiterParsingDisabled="true" schemaValidation="false">
>        <reloadingStrategy refreshDelay="500"
>           config-class="org.apache.commons.configuration.reloading.FileChangedReloadingStrategy"/>
>     </multifile>
>     <xml fileName="portal/default.xml"
>          config-name="defaultConfig" delimiterParsingDisabled="true" schemaValidation="false">
>       <reloadingStrategy refreshDelay="500"
>           config-class="org.apache.commons.configuration.reloading.FileChangedReloadingStrategy"/>
>     </xml>
>   </override>
> </configuration> 
> in the above MultiFileHierarchicalConfiguration config file, I want to load properties from both xml and properties file. Currently, in 1.8, only xml is supported. for .properties file, I get a SAX parsing exception.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira