axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r397446 - /webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
Date Thu, 27 Apr 2006 06:50:27 GMT
Author: ajith
Date: Wed Apr 26 23:50:24 2006
New Revision: 397446

URL: http://svn.apache.org/viewcvs?rev=397446&view=rev
Log:
The new entity resolver treated all URI's as files. Changed that to treat http and https schemes
properly

Modified:
    webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java

Modified: webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java?rev=397446&r1=397445&r2=397446&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
(original)
+++ webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
Wed Apr 26 23:50:24 2006
@@ -453,9 +453,24 @@
                 if(systemId.indexOf(':') == -1) {
                     File f;
                     if (baseUri!=null){
-                        f=new File(new URI(baseUri+systemId));
+                        URI uri = new URI(baseUri + systemId);
+                        if (baseUri.startsWith("file:")){
+                            //it's file
+                             f=new File(uri);
+                        }else{
+                            return new InputSource(
+                                    uri.toURL().openStream()
+                            );
+                        }
                     }else{
-                        f = new File(systemId);
+                        if (systemId.startsWith("http://") ||
+                                systemId.startsWith("https://")){
+                            return new InputSource(systemId);
+                        }else{
+                           //treat it as a file
+                           f = new File(systemId);
+                        }
+
                     }
                     if(f.exists()) {
                         try {



Mime
View raw message