Author: peterjones
Date: Tue Dec 5 15:12:33 2006
New Revision: 482822
URL: http://svn.apache.org/viewvc?view=rev&rev=482822
Log:
[CXF-290] Work around for URIResolver issue with spaces in pathname.
Spaces in the pathname on windows caused problems in the URIResolver (space
characters need to be escaped in a URI). Added a test and made the same
sort of change for a couple of similar issues in the validator tool. There's
still a couple of related things in the wsdl2java tool which I'll track down
later.
Also fixed a couple of typos.
Modified:
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
incubator/cxf/trunk/distribution/src/main/release/NOTICE
incubator/cxf/trunk/distribution/src/main/release/docs/release_notes.txt
incubator/cxf/trunk/distribution/src/main/release/samples/soap12/README.txt
incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLElementReferenceValidator.java
Modified:
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java?view=diff&rev=482822&r1=482821&r2=482822
==============================================================================
---
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
(original)
+++
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
Tue Dec 5 15:12:33 2006
@@ -61,6 +61,7 @@
public URIResolver(String baseUriStr, String uriStr, Class calling) throws
IOException {
this.calling = (calling != null) ? calling : getClass();
+ uriStr = uriStr.replaceAll(" ", "%20");
if (uriStr.startsWith("classpath:")) {
tryClasspath(uriStr);
} else if (baseUriStr != null && baseUriStr.startsWith("jar:")) {
@@ -76,6 +77,7 @@
public void resolve(String baseUriStr, String uriStr, Class callingCls)
throws IOException {
this.calling = (callingCls != null) ? callingCls : getClass();
+ uriStr = uriStr.replaceAll(" ", "%20");
if (uriStr.startsWith("classpath:")) {
tryClasspath(uriStr);
} else if (baseUriStr != null && baseUriStr.startsWith("jar:")) {
Modified: incubator/cxf/trunk/distribution/src/main/release/NOTICE
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/NOTICE?view=diff&rev=482822&r1=482821&r2=482822
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/NOTICE (original)
+++ incubator/cxf/trunk/distribution/src/main/release/NOTICE Tue Dec 5
15:12:33 2006
@@ -1,7 +1,7 @@
=========================================================================
== NOTICE file corresponding to the section 4 d of ==
== the Apache License, Version 2.0, ==
- == in this case for the Apache CXF distribution. ==
+ == in this case for the Apache CXF distribution. ==
=========================================================================
This product includes software developed by
@@ -10,7 +10,7 @@
This product also includes schemas and specification developed by:
- the W3C consortium (http://www.w3c.org) ,
- This product also includes software developed by Spring Framework
+ This product also includes software developed by the Spring Framework
Project (http://www.springframework.org)
This product also includes XMLSchema developed at the apache
@@ -21,8 +21,8 @@
Language for Java Toolkit) developed at Sourceforge. The original
software is available from (http://sourceforge.net/projects/wsdl4j)
- This product also inclues SAAJ (The SOAP with Attachments API for Java)
- The original software is availabe from (http://saaj.dev.java.net/)
+ This product also includes SAAJ (The SOAP with Attachments API for Java)
+ The original software is available from (http://saaj.dev.java.net/)
This product also includes JavaMail api developed by Sun MicroSystems, Inc.
The original software is avaiable from (http://glassfish.dev.java.net/)
@@ -37,13 +37,14 @@
Java Community Process and Sun MicroSystems, Inc. The original software
is available from (http://glassfish.dev.java.net/)
- This product also includes Java Architecture for XML Binding developed by
Java
- Community Process and Sun MicroSystems, Inc. The original software is
- available from (http://jaxb.dev.java.net)
+ This product also includes Java Architecture for XML Binding developed by
+ Java Community Process and Sun MicroSystems, Inc. The original software
+ is available from (http://jaxb.dev.java.net)
This product also includes JavaBeans Activation Framework developed by
- Java Community Process and Sun MicroSystems, Inc. The original software is
- available from
(http://jcp.org/aboutJava/communityprocess/mrel/jsr925/index.html
+ Java Community Process and Sun MicroSystems, Inc. The original software
+ is available from
+ (http://jcp.org/aboutJava/communityprocess/mrel/jsr925/index.html)
This product also includes software developed by Mort Bay Consulting
Pty (http://jetty.mortbay.org)
@@ -51,9 +52,10 @@
This product also includes software developed by Codehaus
(http://woodstox.codehaus.org/)
- This product also includes MTOSI wsdl and schemas developed to
TeleManagement
- Forum (http://www.tmforum.org/browse.aspx). The original MTOSI wsdl and
schemas
- can be download here (http://sourceforge.net/projects/mtosi-ri)
+ This product also includes MTOSI wsdl and schemas developed by the
+ TeleManagement Forum (http://www.tmforum.org/browse.aspx). The original
+ MTOSI wsdl and schemas can be download from
+ (http://sourceforge.net/projects/mtosi-ri)
This product also includes WS-* schemas developed by International
Business Machines Corporation, Microsoft Corporation, BEA Systems,
Modified:
incubator/cxf/trunk/distribution/src/main/release/docs/release_notes.txt
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/docs/release_notes.txt?view=diff&rev=482822&r1=482821&r2=482822
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/docs/release_notes.txt
(original)
+++ incubator/cxf/trunk/distribution/src/main/release/docs/release_notes.txt
Tue Dec 5 15:12:33 2006
@@ -21,7 +21,7 @@
* Complete tooling support, including wsdl2java and java2wsdl, plus a
bunch of other convenient tools
* RESTful web service support
- * JBI container support, Apace CXF services can be deployed into any JBI
+ * JBI container support, Apache CXF services can be deployed into any JBI
compliant container (ServiceMix or OpenESB)
* JCA 1.0 support, J2EE application can integrate with legacy application
through JCA 1.0 support in Apache CXF
Modified:
incubator/cxf/trunk/distribution/src/main/release/samples/soap12/README.txt
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/soap12/README.txt?view=diff&rev=482822&r1=482821&r2=482822
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/soap12/README.txt
(original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/soap12/README.txt
Tue Dec 5 15:12:33 2006
@@ -1,5 +1,5 @@
Hello World SOAP12 Demo using Document/Literal Style
-=============================================
+====================================================
This demo shows the use of Apache CXF's SOAP 1.2 capabilities.
@@ -170,4 +170,4 @@
ant client.get
to invoke the service with simple HttpURLConnection, or you can even
-use your favoriate browser to get the results back.
+use your favorite browser to get the results back.
Modified:
incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java?view=diff&rev=482822&r1=482821&r2=482822
==============================================================================
---
incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
(original)
+++
incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
Tue Dec 5 15:12:33 2006
@@ -71,6 +71,11 @@
if (document == null) {
return schemaList;
}
+ //
+ // If we are on windows we may have spaces in the uri
+ // which need to be escaped.
+ //
+ baseURI = baseURI.replaceAll(" ", "%20");
XmlSchemaCollection schemaCol = new XmlSchemaCollection();
NodeList nodes = document.getElementsByTagNameNS(
WSDLConstants.NS_XMLNS, "schema");
@@ -130,12 +135,15 @@
}
NodeList nodes =
document.getElementsByTagNameNS(WSDLConstants.NS_WSDL, "import");
- // Remove the scheme part of a URI.
+ //
+ // Remove the scheme part of a URI - need to escape spaces in
+ // case we are on Windows and have spaces in directory names.
+ //
String myBasePath = basePath;
try {
- myBasePath = new URI(basePath).getPath();
+ myBasePath = new URI(basePath.replaceAll(" ", "%20")).getPath();
} catch (java.net.URISyntaxException e1) {
- // Is this ok?
+ // This will be problematic...
}
for (int x = 0; x < nodes.getLength(); x++) {
NamedNodeMap attributes = nodes.item(x).getAttributes();
Modified:
incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLElementReferenceValidator.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLElementReferenceValidator.java?view=diff&rev=482822&r1=482821&r2=482822
==============================================================================
---
incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLElementReferenceValidator.java
(original)
+++
incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLElementReferenceValidator.java
Tue Dec 5 15:12:33 2006
@@ -96,7 +96,12 @@
try {
XMLInputFactory factory = XMLInputFactory.newInstance();
factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, true);
- File file = new File(new URI(wsdlId));
+
+ //
+ // If the wsdl is in a directory with spaces (Windows), we need
+ // to escape those characters to avoid a URISyntaxException.
+ //
+ File file = new File(new URI(wsdlId.replaceAll(" ", "%20")));
reader = factory.createXMLEventReader(new FileReader(file));
} catch (XMLStreamException streamEx) {
throw new ToolException(streamEx);