ConfigurationFactory configurationFactory = new ConfigurationFactory();
configurationFactory.setConfigurationFileName(compositeConfigurationFile);
Configuration compositeConfiguration = configurationFactory.getConfiguration();
Configuration mapping = new BaseConfiguration();
Configuration mapping2 = new BaseConfiguration();
for (Iterator keys = simpleConfiguration.getKeys(); keys.hasNext();)
{
String key = (String) keys.next();
String[] keyParts = StringUtils.split(key, ".");
if ((keyParts.length == 3) && keyParts[0].equals("prefix") && keyParts[2].equals("postfix"))
{
String serviceKey = keyParts[1];
if (!mapping.containsKey(serviceKey))
{
mapping.setProperty(serviceKey, simpleConfiguration.getString(key));
}
}
}
for (Iterator keys = compositeConfiguration.getKeys(); keys.hasNext();)
{
String key = (String) keys.next();
String[] keyParts = StringUtils.split(key, ".");
if ((keyParts.length == 3) && keyParts[0].equals("prefix") && keyParts[2].equals("postfix"))
{
String serviceKey = keyParts[1];
if (!mapping2.containsKey(serviceKey))
{
mapping2.setProperty(serviceKey, compositeConfiguration.getString(key));
}
}
}
}