openejb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r634108 - /openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/ResourceFinder.java
Date Thu, 06 Mar 2008 01:21:40 GMT
Author: dblevins
Date: Wed Mar  5 17:21:38 2008
New Revision: 634108

URL: http://svn.apache.org/viewvc?rev=634108&view=rev
Log:
patch our client copy of ResourceFinder to handle url decoding

Modified:
    openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/ResourceFinder.java

Modified: openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/ResourceFinder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/ResourceFinder.java?rev=634108&r1=634107&r2=634108&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/ResourceFinder.java
(original)
+++ openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/ResourceFinder.java
Wed Mar  5 17:21:38 2008
@@ -26,6 +26,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
+import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -856,7 +857,7 @@
     }
 
     private static void readDirectoryEntries(URL location, Map<String, URL> resources)
throws MalformedURLException {
-        File dir = new File(location.getPath());
+        File dir = new File(URLDecoder.decode(location.getPath()));
         if (dir.isDirectory()) {
             File[] files = dir.listFiles();
             for (File file : files) {
@@ -1028,7 +1029,8 @@
                     buf.append(fixedResName);
                     String filename = buf.toString();
                     File file = new File(filename);
-                    if (file.exists()) {
+                    File file2 = new File(URLDecoder.decode(filename));
+                    if (file.exists() || file2.exists()) {
                         return targetURL(currentUrl, fixedResName);
                     }
                 } else {



Mime
View raw message