You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by ms...@apache.org on 2007/01/06 00:51:17 UTC

svn commit: r493248 - /incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLLocatorImpl.java

Author: mszefler
Date: Fri Jan  5 15:51:16 2007
New Revision: 493248

URL: http://svn.apache.org/viewvc?view=rev&rev=493248
Log:
Fixed problem with relative paths.

Modified:
    incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLLocatorImpl.java

Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLLocatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLLocatorImpl.java?view=diff&rev=493248&r1=493247&r2=493248
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLLocatorImpl.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLLocatorImpl.java Fri Jan  5 15:51:16 2007
@@ -3,13 +3,18 @@
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URI;
+import java.net.URISyntaxException;
 
 import javax.wsdl.xml.WSDLLocator;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.xml.sax.InputSource;
 
 public class WSDLLocatorImpl implements WSDLLocator {
 
+    private static final Log __log = LogFactory.getLog(WSDLLocatorImpl.class);
+    
     private ResourceFinder _resourceFinder;
     private URI _base;
     private String _latest;
@@ -33,7 +38,15 @@
     }
 
     public InputSource getImportInputSource(String parent, String imprt) {
-        URI uri = parent == null ? _base.resolve(imprt) : _base.resolve(parent).resolve(imprt);
+        URI uri;
+        try {
+            uri = parent == null ? _base.resolve(imprt) : new URI(parent).resolve(imprt);
+        } catch (URISyntaxException e1) {
+            __log.error("URI syntax error: " + parent);
+            return null;
+        }
+        __log.debug("getImportInputSource: parent=" + parent + ", imprt=" + imprt + ", uri=" + uri);
+
         InputSource is = new InputSource();
         try {
             is.setByteStream(_resourceFinder.openResource(uri));