InputSource source = null;
if (location.startsWith("/")) // NOI18N
location = location.substring(1);
else
location = "WEB-INF/" + location; // NOI18N
ModuleDescriptor moduleDesc = webd.getModuleDescriptor();
String archBase = context.getAbstractArchive().getURI().getPath();
String uri = null;
if(moduleDesc.isStandalone()){
uri = archBase;
} else {
uri = archBase + File.separator +
FileUtils.makeFriendlyFilename(moduleDesc.getArchiveUri());
}
FileArchive arch = new FileArchive();
arch.open(uri);
InputStream is = arch.getEntry(location);
try {
// is can be null if wrong location of tld is specified in web.xml
if (is == null)
throw new IOException(smh.getLocalString
(getClass().getName() + ".exception1", // NOI18N
"Wrong tld [ {0} ] specified in the web.xml of [ {1} ]", // NOI18N
new Object[]{location, moduleDesc.getArchiveUri()}));
source = new InputSource(is);
document = builder.parse(source);
} finally {
try{
if(is != null)