try {
applicationXmlUrl = new URL(moduleBase, "META-INF/application.xml");
} catch (MalformedURLException e) {
return null;
}
ApplicationDocument applicationDoc;
try {
InputStream ddInputStream = applicationXmlUrl.openStream();
applicationDoc = getApplicationDocument(ddInputStream);
} catch (IOException e) {
return null;
} catch (DeploymentException e) {
return null;
}
if (applicationDoc == null) {
return null;
}
// construct the empty geronimo-application.xml
GerApplicationDocument gerApplicationDocument = GerApplicationDocument.Factory.newInstance();
GerApplicationType gerApplication = gerApplicationDocument.addNewApplication();
// set the parentId and configId
gerApplication.setParentId(PARENT_ID);
String id = applicationDoc.getApplication().getId();
if (id == null) {
id = moduleBase.getFile();
if (id.endsWith("!/")) {
id = id.substring(0, id.length() - 2);
}