// Allow multiple resource lookup paths for different component configurations.
String resourceLookupAttrKey = AttributeUtils.getKey(DefaultLexicalDataFactory.class, "resourceLookup");
String altResourceLookupAttrKey = "dcs.resource-lookup";
ProcessingComponentConfiguration [] configurations = componentSuite.getComponentConfigurations();
for (int i = 0; i < configurations.length; i++) {
ProcessingComponentConfiguration config = configurations[i];
Object location = config.attributes.get(altResourceLookupAttrKey);
if (location != null && location instanceof String) {
File resourceDir = new File((String) location);
if (!resourceDir.isDirectory()) {
Logger.getRootLogger().warn("Not a resource folder, ignored: " + resourceDir);
} else {
HashMap<String,Object> mutableMap = new HashMap<String,Object>(config.attributes);
mutableMap.put(resourceLookupAttrKey,
new ResourceLookup(new DirLocator(resourceDir)));
config = configurations[i] = new ProcessingComponentConfiguration(
config.componentClass,
config.componentId,
mutableMap);
}
}