Map map = Collections.synchronizedMap(new TreeMap());
// Parse each template config file and store metadata in configMap
for (Iterator i = configFiles.iterator(); i.hasNext(); ) {
File file = (File)i.next();
ConfigInfo ci = parseXMLconfig(file);
// derive template name from subdirectory name
ci.setName(file.getParentFile().getName());
if (log.isTraceEnabled())
log.trace("file: " + file + " ConfigInfo: " + ci);
Object existingValue = map.put(ci.getName(), ci);
// make sure not two configuration templates with the same name
if (existingValue != null)
throw new Exception("Duplicate template configuration entry: " + ci.getName());
}
this.configMap = map;
// Initialise velocity engine