cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r572578 - /incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessor.java
Date Tue, 04 Sep 2007 08:26:56 GMT
Author: mmao
Date: Tue Sep  4 01:26:53 2007
New Revision: 572578

URL: http://svn.apache.org/viewvc?rev=572578&view=rev
Log:
CXF-886 
  * XSD2WSDL Tool able to access remote xsdurls


Modified:
    incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessor.java

Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessor.java?rev=572578&r1=572577&r2=572578&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessor.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessor.java
Tue Sep  4 01:26:53 2007
@@ -23,6 +23,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Writer;
+import java.net.URL;
 import java.util.logging.Logger;
 
 import javax.wsdl.Definition;
@@ -97,11 +98,16 @@
     private void initXSD() throws ToolException {
         InputStream in;
         try {
-            in = new FileInputStream(xsdUrl);
-        } catch (IOException ioe) {
-            Message msg = new Message("FAIL_TO_OPEN_XSD_FILE", LOG, xsdUrl);
-            throw new ToolException(msg, ioe);
+            in = new URL(xsdUrl).openStream();
+        } catch (Exception m) {
+            try {
+                in = new FileInputStream(xsdUrl);
+            } catch (IOException ioe) {
+                Message msg = new Message("FAIL_TO_OPEN_XSD_FILE", LOG, xsdUrl);
+                throw new ToolException(msg, ioe);
+            }
         }
+
         if (in == null) {
             throw new NullPointerException("Cannot create a ToolSpec object from a null stream");
         }



Mime
View raw message