@@ -0,0 +1,3122 @@
+package com.netflix.config.util;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.HashMap;%0Aimport java.util.IdentityHashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0Aimport org.apache.commons.configuration.AbstractConfiguration;%0Aimport org.apache.commons.configuration.CombinedConfiguration;%0Aimport org.apache.commons.configuration.Configuration;%0A%0Aimport com.netflix.config.ConcurrentCompositeConfiguration;%0Aimport com.netflix.config.ConcurrentMapConfiguration;%0A%0Apublic class ConfigurationUtils %7B%0A    public static ConcurrentCompositeConfiguration convertToConcurrentCompositeConfiguration(CombinedConfiguration config) %7B%0A        ConcurrentCompositeConfiguration root = new ConcurrentCompositeConfiguration();%0A        IdentityHashMap%3CConfiguration, String%3E reverseMap = new IdentityHashMap%3CConfiguration, String%3E();%0A        for (String name: (Set%3CString%3E) config.getConfigurationNames()) %7B%0A            Configuration child = config.getConfiguration(name);%0A            reverseMap.put(child, name);%0A        %7D %0A        for (int i = 0; i %3C config.getNumberOfConfigurations(); i++) %7B%0A            Configuration child = config.getConfiguration(i);%0A            String name = reverseMap.get(child);%0A            if (child instanceof CombinedConfiguration) %7B%0A                CombinedConfiguration combinedConf = (CombinedConfiguration) child;%0A                ConcurrentCompositeConfiguration newConf = convertToConcurrentCompositeConfiguration(combinedConf);%0A                root.addConfiguration(newConf, name);%0A            %7D else %7B%0A                Configuration conf = new ConcurrentMapConfiguration(child);%0A                root.addConfiguration((AbstractConfiguration) conf, name);%0A            %7D%0A        %7D%0A        return root;%0A    %7D%0A    %0A    public static Map%3CString, Configuration%3E getAllNamedConfiguration(Configuration conf) %7B%0A        List%3CConfiguration%3E toProcess = new ArrayList%3CConfiguration%3E();%0A        Map%3CString, Configuration%3E map = new HashMap%3CString, Configuration%3E();%0A        toProcess.add(conf);%0A        while (!toProcess.isEmpty()) %7B%0A            Configuration current = toProcess.remove(0);%0A            if (current instanceof ConcurrentCompositeConfiguration) %7B%0A                ConcurrentCompositeConfiguration composite = (ConcurrentCompositeConfiguration) current;%0A                for (String name: composite.getConfigurationNames()) %7B%0A                    map.put(name, composite.getConfiguration(name));%0A                %7D%0A                for (Configuration c: composite.getConfigurations()) %7B%0A                    toProcess.add(c);%0A                %7D%0A            %7D else if (current instanceof CombinedConfiguration) %7B%0A                CombinedConfiguration combined = (CombinedConfiguration) current;%0A                for (String name: (Set%3CString%3E) combined.getConfigurationNames()) %7B%0A                    map.put(name, combined.getConfiguration(name));%0A                %7D%0A                for (int i = 0; i %3C combined.getNumberOfConfigurations(); i++) %7B%0A                    toProcess.add(combined.getConfiguration(i));%0A                %7D%0A            %7D%0A        %7D%0A        return map;%0A    %7D%0A    %0A%7D%0A

Add ConfigurationUtils.java