}
}
}
break;
case (ITaglibRecord.JAR) : {
IJarRecord record = (IJarRecord) reference;
document = (CMDocumentImpl) buildCMDocumentFromJar(record.getLocation().toString());
document.setLocationString("jar:file:" + record.getLocation().toString() + "!/META-INF/taglib.tld");
if (document.getSmallIcon() != null) {
String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), record.getLocation().toString() + "!/META-INF/", "/"); //$NON-NLS-1$ //$NON-NLS-2$
document.setProperty(JSP12TLDNames.SMALL_ICON, "jar:file:" + iconPath); //$NON-NLS-1$
}
if (document.getLargeIcon() != null) {
String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), record.getLocation().toString() + "!/META-INF/", "/"); //$NON-NLS-1$ //$NON-NLS-2$
document.setProperty(JSP12TLDNames.LARGE_ICON, "jar:file:" + iconPath); //$NON-NLS-1$
}
if (_debug && document != null && document.getElements().getLength() == 0) {
System.out.println("failure parsing " + record.getLocation()); //$NON-NLS-1$
}
}
break;
case (ITaglibRecord.TAGDIR) : {
ITagDirRecord record = (ITagDirRecord) reference;
document = buildCMDocumentFromFolder(record.getPath());
}
break;
case (ITaglibRecord.URL) : {
IURLRecord record = (IURLRecord) reference;
URL url = record.getURL();
InputStream urlContents = JarUtilities.getInputStream(url);
if (urlContents != null) {
document = (CMDocumentImpl) buildCMDocument(record.getBaseLocation(), urlContents);
String urlString = url.toString();
document.setLocationString(urlString);
if (document.getSmallIcon() != null) {
String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), urlString, "/"); //$NON-NLS-1$
document.setProperty(JSP12TLDNames.SMALL_ICON, iconPath);