Author: dkulp
Date: Fri Jul 16 15:10:26 2010
New Revision: 964823

URL: http://svn.apache.org/viewvc?rev=964823&view=rev
Log:
Merged revisions 964822 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r964822 | dkulp | 2010-07-16 11:09:35 -0400 (Fri, 16 Jul 2010) | 2 lines
  
  [CXF-2896] More fixes for folders with spaces
  Patch from William Tam applied
........

Added:
    cxf/branches/2.2.x-fixes/common/common/src/test/resources/wsdl/folder with 
spaces/
      - copied from r964822, 
cxf/trunk/common/common/src/test/resources/wsdl/folder with spaces/
    cxf/branches/2.2.x-fixes/common/common/src/test/resources/wsdl/folder with 
spaces/foo.wsdl
      - copied unchanged from r964822, 
cxf/trunk/common/common/src/test/resources/wsdl/folder with spaces/foo.wsdl
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    
cxf/branches/2.2.x-fixes/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
    
cxf/branches/2.2.x-fixes/common/common/src/test/java/org/apache/cxf/resource/URIResolverTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 16 15:10:26 2010
@@ -1 +1 @@
-/cxf/trunk:964618,964818
+/cxf/trunk:964618,964818,964822

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
cxf/branches/2.2.x-fixes/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java?rev=964823&r1=964822&r2=964823&view=diff
==============================================================================
--- 
cxf/branches/2.2.x-fixes/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
 (original)
+++ 
cxf/branches/2.2.x-fixes/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
 Fri Jul 16 15:10:26 2010
@@ -125,6 +125,10 @@ public class URIResolver {
     private void tryFileSystem(String baseUriStr, String uriStr) throws 
IOException, MalformedURLException {
         try {
             URI relative;
+
+            // It is possible that spaces have been encoded.  We should decode 
them first.
+            uriStr = uriStr.replaceAll("%20", " ");
+
             File uriFile = new File(uriStr);
             uriFile = new File(uriFile.getAbsolutePath());
 

Modified: 
cxf/branches/2.2.x-fixes/common/common/src/test/java/org/apache/cxf/resource/URIResolverTest.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/common/common/src/test/java/org/apache/cxf/resource/URIResolverTest.java?rev=964823&r1=964822&r2=964823&view=diff
==============================================================================
--- 
cxf/branches/2.2.x-fixes/common/common/src/test/java/org/apache/cxf/resource/URIResolverTest.java
 (original)
+++ 
cxf/branches/2.2.x-fixes/common/common/src/test/java/org/apache/cxf/resource/URIResolverTest.java
 Fri Jul 16 15:10:26 2010
@@ -135,5 +135,19 @@ public class URIResolverTest extends Ass
         
     }
 
-
+    @Test
+    public void testBasePathWithSpace() throws Exception {
+        URIResolver wsdlResolver = new URIResolver();
+        // resolve the wsdl
+        wsdlResolver.resolve(null, "wsdl/folder with spaces/foo.wsdl", 
this.getClass());
+        assertTrue(wsdlResolver.isResolved());
+    }
+    
+    @Test
+    public void testBasePathWithEncodedSpace() throws Exception {
+        URIResolver wsdlResolver = new URIResolver();
+        // resolve the wsdl
+        wsdlResolver.resolve(null, "wsdl/folder%20with%20spaces/foo.wsdl", 
this.getClass());
+        assertTrue(wsdlResolver.isResolved());
+    }
 }


Reply via email to