StreamDeploymentPackage source = null;
AbstractDeploymentPackage target = null;
boolean succeeded = false;
try {
JarInputStream jarInput = null;
File tempIndex = null;
File tempContents = null;
try {
File tempDir = m_context.getDataFile(TEMP_DIR);
tempDir.mkdirs();
tempPackage = File.createTempFile(TEMP_PREFIX, TEMP_POSTFIX, tempDir);
tempPackage.delete();
tempPackage.mkdirs();
tempIndex = new File(tempPackage, PACKAGEINDEX_FILE);
tempContents = new File(tempPackage, PACKAGECONTENTS_DIR);
tempContents.mkdirs();
}
catch (IOException e) {
m_log.log(LogService.LOG_ERROR, "Error writing package to disk", e);
throw new DeploymentException(CODE_OTHER_ERROR, "Error writing package to disk", e);
}
try {
jarInput = new ContentCopyingJarInputStream(sourceInput, tempIndex, tempContents);
if (jarInput.getManifest() == null) {
m_log.log(LogService.LOG_ERROR, "Stream does not contain a valid deployment package: missing manifest!");
throw new DeploymentException(CODE_MISSING_HEADER, "No manifest present in deployment package!");
}
}
catch (IOException e) {