/** * Adds the TLD location mapping from the TLD itself. */ private void addTldLocationFromTld(TldLocation tldLocation) throws IOException, SAXException { InputStream in = tldLocation.getInputStream(); try { addTldLocationFromTld(in, tldLocation); } finally { in.close(); } }
private void addTldLocationsFromServletContextResourceTlds(String basePath) throws IOException, SAXException { Set unsortedResourcePaths = servletContext.getResourcePaths(basePath); if (unsortedResourcePaths != null) { List/*<String>*/ resourcePaths = new ArrayList/*<String>*/(unsortedResourcePaths); Collections.sort(resourcePaths); // First process the files... for (Iterator it = resourcePaths.iterator(); it.hasNext(); ) { String resourcePath = (String) it.next(); if (resourcePath.endsWith(".tld")) { addTldLocationFromTld(new ServletContextTldLocation(resourcePath)); } } // ... only later the directories for (Iterator it = resourcePaths.iterator(); it.hasNext(); ) { String resourcePath = (String) it.next(); if (resourcePath.endsWith("/")) { addTldLocationsFromServletContextResourceTlds(resourcePath); } } } }
final String curEntryPath = normalizeJarEntryPath(curEntry.getName(), false); if (curEntryPath.startsWith(metaInfEntryPath) && curEntryPath.endsWith(".tld")) { addTldLocationFromTld(new ServletContextJarEntryTldLocation(jarResourcePath, curEntryPath)); addTldLocationFromTld(zipIn, new ServletContextJarEntryTldLocation(jarResourcePath, curEntryPath));
addTldLocationFromTld(in, tldLocation); } finally { in.close();
private void addTldLocationsFromFileDirectory(final File dir) throws IOException, SAXException { if (dir.isDirectory()) { if (LOG.isDebugEnabled()) { LOG.debug("Scanning for *.tld-s in File directory: " + StringUtil.jQuoteNoXSS(dir)); } File[] tldFiles = dir.listFiles(new FilenameFilter() { public boolean accept(File urlAsFile, String name) { return isTldFileNameIgnoreCase(name); } }); if (tldFiles == null) { throw new IOException("Can't list this directory for some reason: " + dir); } for (int i = 0; i < tldFiles.length; i++) { final File file = tldFiles[i]; addTldLocationFromTld(new FileTldLocation(file)); } } else { LOG.warn("Skipped scanning for *.tld for non-existent directory: " + StringUtil.jQuoteNoXSS(dir)); } }
final String curEntryBaseRelativePath = curEntryPath.substring(baseEntryPath.length()); final URL tldUrl = createJarEntryUrl(jarBaseEntryUrl, curEntryBaseRelativePath); addTldLocationFromTld(new JarEntryUrlTldLocation(tldUrl, null)); final String curEntryBaseRelativePath = curEntryPath.substring(baseEntryPath.length()); final URL tldUrl = createJarEntryUrl(jarBaseEntryUrl, curEntryBaseRelativePath); addTldLocationFromTld(zipIn, new JarEntryUrlTldLocation(tldUrl, null));
/** * Adds the TLD location mapping from the TLD itself. */ private void addTldLocationFromTld(TldLocation tldLocation) throws IOException, SAXException { InputStream in = tldLocation.getInputStream(); try { addTldLocationFromTld(in, tldLocation); } finally { in.close(); } }
/** * Adds the TLD location mapping from the TLD itself. */ private void addTldLocationFromTld(TldLocation tldLocation) throws IOException, SAXException { InputStream in = tldLocation.getInputStream(); try { addTldLocationFromTld(in, tldLocation); } finally { in.close(); } }
private void addTldLocationsFromServletContextResourceTlds(String basePath) throws IOException, SAXException { Set unsortedResourcePaths = servletContext.getResourcePaths(basePath); if (unsortedResourcePaths != null) { List/*<String>*/ resourcePaths = new ArrayList/*<String>*/(unsortedResourcePaths); Collections.sort(resourcePaths); // First process the files... for (Iterator it = resourcePaths.iterator(); it.hasNext(); ) { String resourcePath = (String) it.next(); if (resourcePath.endsWith(".tld")) { addTldLocationFromTld(new ServletContextTldLocation(resourcePath)); } } // ... only later the directories for (Iterator it = resourcePaths.iterator(); it.hasNext(); ) { String resourcePath = (String) it.next(); if (resourcePath.endsWith("/")) { addTldLocationsFromServletContextResourceTlds(resourcePath); } } } }
private void addTldLocationsFromServletContextResourceTlds(String basePath) throws IOException, SAXException { Set unsortedResourcePaths = servletContext.getResourcePaths(basePath); if (unsortedResourcePaths != null) { List/*<String>*/ resourcePaths = new ArrayList/*<String>*/(unsortedResourcePaths); Collections.sort(resourcePaths); // First process the files... for (Iterator it = resourcePaths.iterator(); it.hasNext(); ) { String resourcePath = (String) it.next(); if (resourcePath.endsWith(".tld")) { addTldLocationFromTld(new ServletContextTldLocation(resourcePath)); } } // ... only later the directories for (Iterator it = resourcePaths.iterator(); it.hasNext(); ) { String resourcePath = (String) it.next(); if (resourcePath.endsWith("/")) { addTldLocationsFromServletContextResourceTlds(resourcePath); } } } }
private void addTldLocationsFromFileDirectory(final File dir) throws IOException, SAXException { if (dir.isDirectory()) { if (LOG.isDebugEnabled()) { LOG.debug("Scanning for *.tld-s in File directory: " + StringUtil.jQuoteNoXSS(dir)); } File[] tldFiles = dir.listFiles(new FilenameFilter() { public boolean accept(File urlAsFile, String name) { return isTldFileNameIgnoreCase(name); } }); if (tldFiles == null) { throw new IOException("Can't list this directory for some reason: " + dir); } for (int i = 0; i < tldFiles.length; i++) { final File file = tldFiles[i]; addTldLocationFromTld(new FileTldLocation(file)); } } else { LOG.warn("Skipped scanning for *.tld for non-existent directory: " + StringUtil.jQuoteNoXSS(dir)); } }
final String curEntryPath = normalizeJarEntryPath(curEntry.getName(), false); if (curEntryPath.startsWith(metaInfEntryPath) && curEntryPath.endsWith(".tld")) { addTldLocationFromTld(new ServletContextJarEntryTldLocation(jarResourcePath, curEntryPath)); addTldLocationFromTld(zipIn, new ServletContextJarEntryTldLocation(jarResourcePath, curEntryPath));
final String curEntryPath = normalizeJarEntryPath(curEntry.getName(), false); if (curEntryPath.startsWith(metaInfEntryPath) && curEntryPath.endsWith(".tld")) { addTldLocationFromTld(new ServletContextJarEntryTldLocation(jarResourcePath, curEntryPath)); addTldLocationFromTld(zipIn, new ServletContextJarEntryTldLocation(jarResourcePath, curEntryPath));
addTldLocationFromTld(in, tldLocation); } finally { in.close();
private void addTldLocationsFromFileDirectory(final File dir) throws IOException, SAXException { if (dir.isDirectory()) { if (LOG.isDebugEnabled()) { LOG.debug("Scanning for *.tld-s in File directory: " + StringUtil.jQuoteNoXSS(dir)); } File[] tldFiles = dir.listFiles(new FilenameFilter() { public boolean accept(File urlAsFile, String name) { return isTldFileNameIgnoreCase(name); } }); if (tldFiles == null) { throw new IOException("Can't list this directory for some reason: " + dir); } for (int i = 0; i < tldFiles.length; i++) { final File file = tldFiles[i]; addTldLocationFromTld(new FileTldLocation(file)); } } else { LOG.warn("Skipped scanning for *.tld for non-existent directory: " + StringUtil.jQuoteNoXSS(dir)); } }
addTldLocationFromTld(in, tldLocation); } finally { in.close();
final String curEntryBaseRelativePath = curEntryPath.substring(baseEntryPath.length()); final URL tldUrl = createJarEntryUrl(jarBaseEntryUrl, curEntryBaseRelativePath); addTldLocationFromTld(new JarEntryUrlTldLocation(tldUrl, null)); final String curEntryBaseRelativePath = curEntryPath.substring(baseEntryPath.length()); final URL tldUrl = createJarEntryUrl(jarBaseEntryUrl, curEntryBaseRelativePath); addTldLocationFromTld(zipIn, new JarEntryUrlTldLocation(tldUrl, null));
final String curEntryBaseRelativePath = curEntryPath.substring(baseEntryPath.length()); final URL tldUrl = createJarEntryUrl(jarBaseEntryUrl, curEntryBaseRelativePath); addTldLocationFromTld(new JarEntryUrlTldLocation(tldUrl, null)); final String curEntryBaseRelativePath = curEntryPath.substring(baseEntryPath.length()); final URL tldUrl = createJarEntryUrl(jarBaseEntryUrl, curEntryBaseRelativePath); addTldLocationFromTld(zipIn, new JarEntryUrlTldLocation(tldUrl, null));