File contentCopy = new File(tempDir, userSpecifedName);
os = new BufferedOutputStream(new FileOutputStream(contentCopy));
ContentContext contentContext = resourceContext.getContentContext();
ContentServices contentServices = contentContext.getContentServices();
contentServices.downloadPackageBitsForChildResource(contentContext, resourceType.getName(), key, os);
return contentCopy;
} catch (IOException e) {
throw new IllegalStateException("Failed to copy the deployed archive to destination.", e);
} finally {