Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 387D176F6 for ; Wed, 26 Oct 2011 12:47:56 +0000 (UTC) Received: (qmail 19734 invoked by uid 500); 26 Oct 2011 12:47:56 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 19657 invoked by uid 500); 26 Oct 2011 12:47:55 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 19650 invoked by uid 99); 26 Oct 2011 12:47:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Oct 2011 12:47:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Oct 2011 12:47:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DE3852388A36 for ; Wed, 26 Oct 2011 12:47:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1189176 - /cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java Date: Wed, 26 Oct 2011 12:47:31 -0000 To: commits@cxf.apache.org From: ay@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111026124731.DE3852388A36@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ay Date: Wed Oct 26 12:47:31 2011 New Revision: 1189176 URL: http://svn.apache.org/viewvc?rev=1189176&view=rev Log: [CXF-3884] DynamicClientFactory#setupClassPath to handle url encoded paths Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=1189176&r1=1189175&r2=1189176&view=diff ============================================================================== --- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java (original) +++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java Wed Oct 26 12:47:31 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; @@ -513,22 +515,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"));