private ResourceHandle installUnsharedResourceInternal(String runtimeName, Context context, Resource resource) throws Exception {
LOGGER.info("Installing unshared resource: {}", resource);
File tempfile = null;
ResourceIdentity identity = resource.getIdentity();
ContentCapability ccap = (ContentCapability) resource.getCapabilities(ContentNamespace.CONTENT_NAMESPACE).get(0);
URL contentURL = ccap.getContentURL();
if (contentURL == null) {
ResourceContent content = resource.adapt(ResourceContent.class);
IllegalStateAssertion.assertNotNull(content, "Cannot obtain content from: " + resource);
tempfile = new File(catalinaTemp, identity.getSymbolicName() + "-" + identity.getVersion() + ".war");
IOUtils.copyStream(content.getContent(), new FileOutputStream(tempfile));