*/
protected CreateResourceReport deployContent(CreateResourceReport report) {
ContentContext cctx = context.getContentContext();
ResourcePackageDetails details = report.getPackageDetails();
ContentServices contentServices = cctx.getContentServices();
String resourceTypeName = report.getResourceType().getName();
ASUploadConnection uploadConnection = new ASUploadConnection(getServerComponent().getASConnection(), details
.getKey().getName());
OutputStream out = uploadConnection.getOutputStream();
if (out == null) {
report.setStatus(CreateResourceStatus.FAILURE);
report.setErrorMessage("An error occured while the agent was preparing for content download");
return report;
}
long size;
try {
size = contentServices.downloadPackageBitsForChildResource(cctx, resourceTypeName, details.getKey(), out);
} catch (Exception e) {
uploadConnection.cancelUpload();
report.setStatus(CreateResourceStatus.FAILURE);
LOG.debug("Failed to pull package from server", e);
report.setErrorMessage("An error occured while the agent was uploading the content for ["