commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Boyle" <bboyl...@gmail.com>
Subject Commons Configuration - Saving a combined configuration
Date Wed, 26 Nov 2008 20:44:44 GMT
Hi there,

I am using the OverrideCombiner class to combine two XMLConfigurations
together. This works fine and then I set this combined configuration as the
RootNode of a new XMLConfigruation. I am then trying to save this newly
created configuration as a new file and this does not seem to work. Does
anybody know if this is possible or have a missed a step along the way?

Thanks,

Brian
P.S. Here is my code.

           XMLConfiguration masterConf = new XMLConfiguration();
           XMLConfiguration localConf = new XMLConfiguration();
            masterConf.load("resources/Masterconfig.xml");
            localConf.load("resources/localConfig.xml");

            NodeCombiner combiner = new OverrideCombiner();
            ConfigurationNode cn = combiner.combine(localConf.getRootNode(),
masterConf.getRootNode());

            XMLConfiguration result = new XMLConfiguration();
            result.setRootNode(cn);
            result.save("resources/CombinedConfig.xml");

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message