while (i.hasNext())
{
Object thing = i.next();
if (thing instanceof String)
{
XMLConfiguration vhostConfiguration = new XMLConfiguration((String) thing);
List hosts = vhostConfiguration.getList("virtualhost.name");
for (int j = 0; j < hosts.size(); j++)
{
String name = (String) hosts.get(j);
// Add the keys of the virtual host to the main config then bail out
Configuration myConf = vhostConfiguration.subset("virtualhost." + name);
Iterator k = myConf.getKeys();
while (k.hasNext())
{
String key = (String) k.next();
conf.setProperty("virtualhosts.virtualhost."+name+"."+key, myConf.getProperty(key));
}
VirtualHostConfiguration vhostConfig = new VirtualHostConfiguration(name, conf.subset("virtualhosts.virtualhost."+name));
_virtualHosts.put(vhostConfig.getName(), vhostConfig);
}
// Grab things other than the virtualhosts themselves
Iterator keys = vhostConfiguration.getKeys();
while (keys.hasNext())
{
String key = (String) keys.next();
conf.setProperty("virtualhosts."+key, vhostConfiguration.getProperty(key));
}
}
}
}