axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r291139 - /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
Date Fri, 23 Sep 2005 15:34:28 GMT
Author: deepal
Date: Fri Sep 23 08:34:22 2005
New Revision: 291139

URL: http://svn.apache.org/viewcvs?rev=291139&view=rev
Log:
There was a problem when an archive file contains multiple wsdls , thanks Gayan finding the
bug

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?rev=291139&r1=291138&r2=291139&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
Fri Sep 23 08:34:22 2005
@@ -41,13 +41,7 @@
 import javax.wsdl.WSDLException;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
 import java.util.Iterator;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
@@ -152,7 +146,11 @@
                         if(fileName.endsWith(".wsdl") || fileName.endsWith(".WSDL")){
                             InputStream in = new FileInputStream(file1);
                             processWSDLFile(in,depengine);
-                            in.close();
+                            try {
+                                in.close();
+                            } catch (IOException e) {
+                                log.info(e);
+                            }
                         }
                     }
                 } else {
@@ -169,14 +167,26 @@
             try {
                 zin = new ZipInputStream(new FileInputStream(serviceFile));
                 ZipEntry entry;
+                byte[] buf = new byte[1024];
+                int read;
+                ByteArrayOutputStream out ;
                 while ((entry = zin.getNextEntry()) != null) {
                     String entryName = entry.getName();
                     if (entryName.startsWith(META_INF) && (entryName.endsWith(".wsdl")
                             || entryName.endsWith(".WSDL"))) {
-                        processWSDLFile(zin,depengine);
+                        out = new ByteArrayOutputStream();
+                        while ((read = zin.read(buf)) > 0) {
+                            out.write(buf, 0, read);
+                        }
+                        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
+                        processWSDLFile(in,depengine);
                     }
                 }
-                zin.close();
+                try {
+                    zin.close();
+                } catch (IOException e) {
+                    log.info(e);
+                }
             } catch (FileNotFoundException e) {
                 throw new DeploymentException(e);
             } catch (IOException e) {
@@ -308,7 +318,7 @@
                 }
             } else {
                 throw new DeploymentException(Messages.getMessage(
-                            DeploymentErrorMsgs.MODULEXML_NOT_FOUND_FOR_THE_MODULE, filename));
+                        DeploymentErrorMsgs.MODULEXML_NOT_FOUND_FOR_THE_MODULE, filename));
             }
 
         }



Mime
View raw message