Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=44380
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 11 Apr 2008 23:07:10 +0000 (23:07 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 11 Apr 2008 23:07:10 +0000 (23:07 +0000)
Don't bother scanning non-file URLs for TLDs.
Patch provided by Florent BENOIT

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@647345 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/TldConfig.java

index 9bc209b..1dde2ec 100644 (file)
@@ -679,11 +679,17 @@ public final class TldConfig  {
             if (loader instanceof URLClassLoader) {
                 URL[] urls = ((URLClassLoader) loader).getURLs();
                 for (int i=0; i<urls.length; i++) {
-                    // Expect file URLs, these are %xx encoded or not depending on
-                    // the class loader
+                    // Expect file URLs, these are %xx encoded or not depending
+                    // on the class loader
                     // This is definitely not as clean as using JAR URLs either
                     // over file or the custom jndi handler, but a lot less
                     // buggy overall
+                    
+                    // Check that the URL is using file protocol, else ignore it
+                    if (!"file".equals(urls[i].getProtocol())) {
+                        continue;
+                    }
+                    
                     File file = null;
                     try {
                         file = new File(urls[i].toURI());