This method looks to the deployment for a META-INF/application-client.xml
descriptor to identify a j2ee client jar.
boolean accepts = false;
// The jar must contain an META-INF/application-client.xml
VirtualFile dd = unit.getMetaDataFile(jbossClientXmlPath);
if (dd != null)
{
log.debug("Found application-client.xml file: " + unit.getName());
try
{
Element root = DOMUtils.parse(dd.openStream());
DocumentType doctype = root.getOwnerDocument().getDoctype();
String publicId = (doctype != null ? doctype.getPublicId() : null);
// Accept the JBoss5 publicId
accepts = "-//JBoss//DTD Application Client 5.0//EN".equals(publicId);
if (accepts == false)
log.debug("Ignore jboss-client.xml with publicId: " + publicId);
}
catch (IOException ex)
{
DeploymentException.rethrowAsDeploymentException("Cannot parse " + jbossClientXmlPath, ex);
}
}
return accepts;