Author: dkulp
Date: Thu Mar 11 17:14:09 2010
New Revision: 921946
URL: http://svn.apache.org/viewvc?rev=921946&view=rev
Log:
Merged revisions 921942 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r921942 | dkulp | 2010-03-11 12:11:30 -0500 (Thu, 11 Mar 2010) | 2 lines
[CXF-2703] More issues with spaces in wsdl/jar locations
Patch from Craig Tataryn applied
........
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
Propchange: cxf/branches/2.2.x-fixes/
('svn:mergeinfo' removed)
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=921946&r1=921945&r2=921946&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
Thu Mar 11 17:14:09 2010
@@ -291,17 +291,28 @@ public class URIResolver {
try {
uri = url.toURI();
} catch (URISyntaxException e) {
- // processing the jar:file:/ type value
- String urlStr = url.toString();
- if (urlStr.startsWith("jar:")
- || urlStr.startsWith("zip:")
- || urlStr.startsWith("wsjar:")) {
- int pos = urlStr.indexOf('!');
- if (pos != -1) {
- try {
- uri = new URI("classpath:" + urlStr.substring(pos
+ 1));
- } catch (URISyntaxException ue) {
- // ignore
+ // yep, some versions of the JDK can't handle spaces when
URL.toURI() is called, and lots of people
+ // on windows have their maven repositories at C:/Documents
and Settings/<userid>/.m2/repository
+ // re:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6506304
+ if (url.toString().contains(" ")) {
+ url = new URL(url.toString().replace(" ", "%20"));
+ }
+ //let's try this again
+ try {
+ uri = url.toURI();
+ } catch (URISyntaxException e1) {
+ // processing the jar:file:/ type value
+ String urlStr = url.toString();
+ if (urlStr.startsWith("jar:")
+ || urlStr.startsWith("zip:")
+ || urlStr.startsWith("wsjar:")) {
+ int pos = urlStr.indexOf('!');
+ if (pos != -1) {
+ try {
+ uri = new URI("classpath:" +
urlStr.substring(pos + 1));
+ } catch (URISyntaxException ue) {
+ // ignore
+ }
}
}
}