public Artifact getConfigurationID(Object plan,
JarFile jarFile,
ModuleIDBuilder idBuilder)
throws IOException, DeploymentException {
ApplicationMetadataFactory factory = getApplicationMetadataFactory();
IDirectory ebaFile = FileSystem.getFSRoot(new File(jarFile.getName()));
IFile applicationManifestFile = ebaFile.getFile(AppConstants.APPLICATION_MF);
Manifest applicationManifest;
if (applicationManifestFile != null) {
InputStream in = applicationManifestFile.open();
try {
applicationManifest = ManifestProcessor.parseManifest(in);
} finally {
try { in.close(); } catch (IOException ignore) {}
}
} else {
applicationManifest = new Manifest();
}
ManifestDefaultsInjector.updateManifest(applicationManifest, ebaFile.getName(), ebaFile);
ApplicationMetadata metadata = factory.createApplicationMetadata(applicationManifest);
return ApplicationInstaller.getConfigId(metadata);
}