}
if (groupNameMappingFile != null) {
getLog().info("groupNameMappingFile: " + groupNameMappingFile);
}
final Collection<String> groupsAsList = getTargetGroupsAsList();
final StopWatch watch = new StopWatch();
watch.start("processGroups: " + groupsAsList);
final Collection<Callable<Void>> callables = new ArrayList<Callable<Void>>();
for (final String group : groupsAsList) {
for (final ResourceType resourceType : ResourceType.values()) {
final File destinationFolder = computeDestinationFolder(resourceType);
final String groupWithExtension = group + "." + resourceType.name().toLowerCase();
if (isParallelProcessing()) {
callables.add(Context.decorate(new Callable<Void>() {
public Void call()
throws Exception {
processGroup(groupWithExtension, destinationFolder);
return null;
}
}));
} else {
processGroup(groupWithExtension, destinationFolder);
}
}
}
if (isParallelProcessing()) {
getTaskExecutor().submit(callables);
}
watch.stop();
getLog().debug(watch.prettyPrint());
writeGroupNameMap();
}