op.get(ENABLED).set(true);
op.get(PERSISTENT).set(false); // prevents writing this deployment out to standalone.xml
Module module = Module.forClass(getClass());
URL url = module.getExportedResource(StartupExtension.DEPLOYMENT_APP_EAR);
if (url == null) {
throw new FileNotFoundException("Could not find the EAR");
}
ModelNode contentItem = new ModelNode();
boolean explodedDeployment = true; // this is here just to keep the code around that deploys if we are unexploded
if (explodedDeployment) {
String urlString = new File(url.toURI()).getAbsolutePath();
if (!(new File(urlString).exists())) {
throw new FileNotFoundException("Missing the EAR at [" + urlString + "]");
}
contentItem.get(PATH).set(urlString);
contentItem.get(ARCHIVE).set(false);
} else {
String urlString = url.toExternalForm();
contentItem.get(URL).set(urlString);
}
op.get(CONTENT).add(contentItem);