use of org.apache.commons.configuration2.tree.MergeCombiner in project sponge by softelnet.
the class DefaultConfigurationManager method createRootConfig.
protected CommonsConfiguration createRootConfig() {
MergeCombiner combiner = new MergeCombiner();
combiner.addListNode(PluginManagerConstants.CFG_PLUGIN);
CombinedConfiguration cc = new CombinedConfiguration(combiner);
// Try to add explicit configuration
if (configurationFilename != null) {
logger.info("Loading configuration file {}...", configurationFilename);
Pair<XMLConfiguration, URL> configurationPair = createXmlConfiguration(configurationFilename);
cc.addConfiguration(configurationPair.getLeft());
configurationFileUrl = configurationPair.getRight();
}
// Add default configuration
cc.addConfiguration(createXmlConfiguration(ConfigurationConstants.DEFAULT_CONFIG).getLeft());
return new CommonsConfiguration(cc);
}
Aggregations