properties.setProperty(GENERATION_KEY + bundleId, Integer.toString(generation));
File archiveRoot = FileUtils.buildPath(root, BUNDLES_DIR, bundleId, GENERATIONS_DIR, generation);
if (archiveRoot.exists()) throw new FatalError("Archive store location " + archiveRoot + " already exists");
if (!archiveRoot.mkdirs()) throw new FatalError("Unable to create archive store location: " + archiveRoot);
result = new ArchiveFileStore(framework, bundleId, generation, archiveRoot, inputStream);
save();
}
catch (NumberFormatException nfe)
{
LOGGER.log(Level.SEVERE, "Unable to obtain last generation", nfe);
throw new FatalError("Unable to obtain last generation", nfe);
}
LOGGER.exiting(CLASS_NAME, "allocateArchiveStore", result);
return result;