mapper = ExternalLocationMapper.getInstance();
if (INITIALIZATION_MODE_ARCHIVE.equalsIgnoreCase(setting)) {
// if this data was extracted from a ZIP File, check to see if
// external resources were included in that ZIP.
ExternalResourceManifestXMLv1 loader = new ExternalResourceManifestXMLv1();
if (mapper.loadMappings(loader.load(baseDir))) {
defaultMapDataSource = baseDir;
} else {
// the zip file did not contain any archived external resources.
// this might mean it wasn't created by the FileBackupManager,
// but by an individual zipping up a set of team data
// directories. Fall back to the auto-search mode.
setting = INITIALIZATION_MODE_AUTO;
}
}
if (INITIALIZATION_MODE_AUTO.equalsIgnoreCase(setting)) {
final ExternalResourceAutoLocator loader = new ExternalResourceAutoLocator();
dispatchAllImportInstructions(new ImportInstructionDispatcher() {
public Object dispatch(ImportDirectoryInstruction instr) {
String directory = instr.getDirectory();
if (directory != null && directory.length() > 0)
loader.addImportedPath(directory);
return null;
}});
mapper.loadMappings(loader.load(baseDir));
// NOTE: this style of resource mapping is not supported by the
// "default map data source" functionality at this time.
}
}