Map<String, String> identifierMap,
Map<String, File> tempFileMappings) throws MigrationException {
for (String tempFileLabel : tempFileMappings.keySet()) {
if (identifierMap.containsKey(tempFileLabel)) {
throw new MigrationException(String.format(
"The identifier map already contains an element with "
+ "the key '%s'. Cannot add the temporay file "
+ "mapping '%s = %s'.", tempFileLabel,
tempFileLabel, tempFileMappings.get(tempFileLabel)));
}
try {
identifierMap.put(tempFileLabel, tempFileMappings.get(
tempFileLabel).getCanonicalPath());
} catch (SecurityException se) {
throw new MigrationException(
String.format(
"Failed accessing the canonical file path of the "
+ "temporary file labeled '%s'",
tempFileLabel), se);
} catch (IOException ioe) {
throw new MigrationException(
String.format(
"Failed accessing the canonical file path of the "
+ "temporary file labeled '%s'",
tempFileLabel), ioe);
}