.getDeploymentsForType(KnownDeploymentTypes.JavaEEWebApplication
.getType());
} catch (Exception e) {
throw new IllegalStateException(e);
}
ManagedDeployment standaloneWarDeployment = null;
for (ManagedDeployment warDeployment : warDeployments) {
if (warDeployment.getParent() == null) {
standaloneWarDeployment = warDeployment;
break;
}
}
if (standaloneWarDeployment == null)
// This could happen if no standalone WARs, including the admin
// console WAR, have been fully deployed yet.
return null;
URL warUrl;
try {
warUrl = new URL(standaloneWarDeployment.getName());
} catch (MalformedURLException e) {
throw new IllegalStateException(e);
}
File warFile = new File(warUrl.getPath());
File deployDir = warFile.getParentFile();