use of org.glassfish.web.deployment.io.WebDeploymentDescriptorFile in project Payara by payara.
the class WebCheckMgrImpl method check.
/**
* Check method introduced for WebServices integration
*
* @param descriptor Web descriptor
*/
public void check(Descriptor descriptor) throws Exception {
// run persistence tests first.
checkPersistenceUnits(WebBundleDescriptor.class.cast(descriptor));
// a WebBundleDescriptor can have an WebServicesDescriptor
checkWebServices(descriptor);
// a WebBundleDescriptor can have WebService References
checkWebServicesClient(descriptor);
if (verifierFrameworkContext.isPartition() && !verifierFrameworkContext.isWeb())
return;
// create document obj for all tld's defined in the war
createTaglibDescriptors(descriptor);
createFacesConfigDescriptor(descriptor);
// run the ParseDD test
if (getSchemaVersion(descriptor).compareTo("2.4") < 0) {
// NOI18N
WebDeploymentDescriptorFile ddf = new WebDeploymentDescriptorFile();
File file = new File(getAbstractArchiveUri(descriptor), ddf.getDeploymentDescriptorPath());
FileInputStream is = new FileInputStream(file);
try {
if (is != null) {
Result result = new ParseDD().validateWebDescriptor(is);
result.setComponentName(getArchiveUri(descriptor));
setModuleName(result);
verifierFrameworkContext.getResultManager().add(result);
is.close();
}
} finally {
try {
if (is != null)
is.close();
} catch (Exception e) {
}
}
}
super.check(descriptor);
}
use of org.glassfish.web.deployment.io.WebDeploymentDescriptorFile in project Payara by payara.
the class WebArchivist method getPlainDefaultWebXmlBundleDescriptor.
/**
* @return a non-validated WebBundleDescriptor corresponding to default-web.xml
*/
private WebBundleDescriptorImpl getPlainDefaultWebXmlBundleDescriptor() {
WebBundleDescriptorImpl defaultWebBundleDesc = new WebBundleDescriptorImpl();
InputStream fis = null;
try {
// parse default-web.xml contents
URL defaultWebXml = getDefaultWebXML();
if (defaultWebXml != null) {
fis = defaultWebXml.openStream();
WebDeploymentDescriptorFile wddf = new WebDeploymentDescriptorFile();
wddf.setXMLValidation(false);
defaultWebBundleDesc.addWebBundleDescriptor(wddf.read(fis));
}
} catch (Exception e) {
logger.log(Level.WARNING, LogFacade.ERROR_PARSING);
} finally {
try {
if (fis != null) {
fis.close();
}
} catch (IOException ioe) {
// do nothing
}
}
return defaultWebBundleDesc;
}
Aggregations