You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/10/26 18:20:29 UTC

svn commit: r1189291 - in /cxf/branches/2.3.x-fixes: ./ rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java

Author: dkulp
Date: Wed Oct 26 16:20:29 2011
New Revision: 1189291

URL: http://svn.apache.org/viewvc?rev=1189291&view=rev
Log:
Merged revisions 1189270 via svnmerge from 
https://svn.us.apache.org/repos/asf/cxf/branches/2.4.x-fixes

................
  r1189270 | ay | 2011-10-26 11:39:10 -0400 (Wed, 26 Oct 2011) | 9 lines
  
  Merged revisions 1189176 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1189176 | ay | 2011-10-26 14:47:31 +0200 (Wed, 26 Oct 2011) | 1 line
    
    [CXF-3884] DynamicClientFactory#setupClassPath to handle url encoded paths
  ........
................

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java

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

Modified: cxf/branches/2.3.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=1189291&r1=1189290&r2=1189291&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java (original)
+++ cxf/branches/2.3.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java Wed Oct 26 16:20:29 2011
@@ -22,12 +22,14 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.net.URLDecoder;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
@@ -511,22 +513,18 @@ public class DynamicClientFactory {
                 }
                 for (URL url : urls) {
                     if (url.getProtocol().startsWith("file")) {
-                        File file;
-                        try { 
-                            URI uri = new URI(url.getProtocol(), null, url.getPath(), null, null);
-
-                            if (uri.getPath() == null) {
-                                continue;
-                            }
-                            file = new File(uri.getPath()); 
-                        } catch (URISyntaxException urise) { 
+                        File file = null;
+                        // CXF-3884 use url-decoder to get the decoded file path from the url
+                        try {
                             if (url.getPath() == null) {
                                 continue;
                             }
-                            file = new File(url.getPath()); 
+                            file = new File(URLDecoder.decode(url.getPath(), "utf-8")); 
+                        } catch (UnsupportedEncodingException uee) {
+                            // ignored as utf-8 is supported
                         } 
 
-                        if (file.exists()) { 
+                        if (null != file && file.exists()) { 
                             classPath.append(file.getAbsolutePath()) 
                                 .append(System 
                                         .getProperty("path.separator"));