svn commit: r566184 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r566184 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java

jstrachan-2
Author: jstrachan
Date: Wed Aug 15 07:20:57 2007
New Revision: 566184

URL: http://svn.apache.org/viewvc?view=rev&rev=566184
Log:
minor patch to avoid whitespace on names, just in case

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java?view=diff&rev=566184&r1=566183&r2=566184
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java Wed Aug 15 07:20:57 2007
@@ -253,7 +253,9 @@
 
         while (urls.hasMoreElements()) {
             try {
-                String urlPath = urls.nextElement().getFile();
+                URL url = urls.nextElement();
+
+                String urlPath = url.getFile();
                 urlPath = URLDecoder.decode(urlPath, "UTF-8");
 
                 // If it's a file in a directory, trim the stupid file: spec
@@ -299,12 +301,16 @@
 
         for (File file : files) {
             builder = new StringBuilder(100);
-            builder.append(parent).append("/").append(file.getName());
-            String packageOrClass = parent == null ? file.getName() : builder.toString();
+            String name = file.getName();
+            if (name != null) {
+                name = name.trim();
+            }
+            builder.append(parent).append("/").append(name);
+            String packageOrClass = parent == null ? name : builder.toString();
 
             if (file.isDirectory()) {
                 loadImplementationsInDirectory(test, packageOrClass, file);
-            } else if (file.getName().endsWith(".class")) {
+            } else if (name.endsWith(".class")) {
                 addIfMatching(test, packageOrClass);
             }
         }
@@ -328,6 +334,9 @@
 
             while ((entry = jarStream.getNextJarEntry()) != null) {
                 String name = entry.getName();
+                if (name != null) {
+                    name = name.trim();
+                }
                 if (!entry.isDirectory() && name.startsWith(parent) && name.endsWith(".class")) {
                     addIfMatching(test, name);
                 }