((ScatteredArchive) archive).type()==ScatteredArchive.Builder.type.war);
}
@Override
public ClassLoader getClassLoader(ClassLoader parent, DeploymentContext context) {
ScatteredArchive archive = (ScatteredArchive) context.getSource();
WebappClassLoader cloader = new WebappClassLoader(parent);
try {
FileDirContext r = new FileDirContext();
File base = archive.getResourcesDir();
r.setDocBase(base.getAbsolutePath());
File sunWeb = archive.getFile("WEB-INF/sun-web.xml");
SunWebXmlParser sunWebXmlParser = null;
if (sunWeb!=null && sunWeb.exists()) {
sunWebXmlParser = new SunWebXmlParser(sunWeb.getParentFile().getParent());
}
cloader.setResources(r);
for (URL url : archive.getClassPath()) {
cloader.addRepository(url.toExternalForm());
}
if (context.getScratchDir("jsp") != null) {
cloader.setWorkDir(context.getScratchDir("jsp"));
}