Scan web application resources for TLDs, recursively. @param startPath the directory resource to scan @throws IOException if there was a problem scanning for or loading a TLD @throws SAXException if there was a problem parsing a TLD
(String startPath)
| 205 | * @throws SAXException if there was a problem parsing a TLD |
| 206 | */ |
| 207 | protected void scanResourcePaths(String startPath) throws IOException, SAXException { |
| 208 | |
| 209 | boolean found = false; |
| 210 | Set<String> dirList = context.getResourcePaths(startPath); |
| 211 | if (dirList != null) { |
| 212 | for (String path : dirList) { |
| 213 | if (path.startsWith("/WEB-INF/classes/")) { |
| 214 | // Skip: JSP.7.3.1 |
| 215 | } else if (path.startsWith("/WEB-INF/lib/")) { |
| 216 | // Skip: JSP.7.3.1 |
| 217 | } else if (path.endsWith("/")) { |
| 218 | scanResourcePaths(path); |
| 219 | } else if (path.startsWith("/WEB-INF/tags/")) { |
| 220 | // JSP 7.3.1: in /WEB-INF/tags only consider implicit.tld |
| 221 | if (path.endsWith("/implicit.tld")) { |
| 222 | found = true; |
| 223 | parseTld(path); |
| 224 | } |
| 225 | } else if (path.endsWith(TLD_EXT)) { |
| 226 | found = true; |
| 227 | parseTld(path); |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | if (found) { |
| 232 | if (log.isDebugEnabled()) { |
| 233 | log.debug(Localizer.getMessage("jsp.tldCache.tldInResourcePath", startPath)); |
| 234 | } |
| 235 | } else { |
| 236 | if (log.isDebugEnabled()) { |
| 237 | log.debug(Localizer.getMessage("jsp.tldCache.noTldInResourcePath", startPath)); |
| 238 | } |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * Scan for TLDs in JARs in /WEB-INF/lib. |
no test coverage detected