Author: ay
Date: Wed Oct 26 15:39:10 2011
New Revision: 1189270
URL: http://svn.apache.org/viewvc?rev=1189270&view=rev
Log:
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.4.x-fixes/ (props changed)
cxf/branches/2.4.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct 26 15:39:10 2011
@@ -1 +1 @@
-/cxf/trunk:1189058
+/cxf/trunk:1189058,1189176
Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.4.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=1189270&r1=1189269&r2=1189270&view=diff
==============================================================================
---
cxf/branches/2.4.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
(original)
+++
cxf/branches/2.4.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Wed Oct 26 15:39:10 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"));