Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 28517 invoked from network); 1 Nov 1999 20:59:07 -0000 Received: from mercury.sun.com (192.9.25.1) by apache.org with SMTP; 1 Nov 1999 20:59:07 -0000 Received: from engmail3.Eng.Sun.COM ([129.144.170.5]) by mercury.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id MAA02155 for ; Mon, 1 Nov 1999 12:59:04 -0800 (PST) From: costin@eng.sun.com Received: from eng.sun.com (costin.Eng.Sun.COM [129.144.251.103]) by engmail3.Eng.Sun.COM (8.9.1b+Sun/8.9.1/ENSMAIL,v1.6) with ESMTP id MAA20565 for ; Mon, 1 Nov 1999 12:59:02 -0800 (PST) Sender: costin@engmail3.Eng.Sun.COM Message-ID: <381DFED1.73720DF1@eng.sun.com> Date: Mon, 01 Nov 1999 20:57:53 +0000 X-Mailer: Mozilla 4.51 [en] (X11; U; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-dev@jakarta.apache.org Subject: Re: tomcat diffs References: <000101bf22fe$dedb1300$1401a8c0@mpetteys.colybrand.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Matt wrote: > Could someone commit these.. Rewrote windows bootstrap script to run on NT, > catch command line args exception in ant, and catch FileNotFoundException > when trying to upack a war file.. Hi Matt, There are 2 problems with the WARUtil patch. First, it seems you use a different indentation, and that makes hard to detect the changes. Second, I don't understand where FileNotFoundException happened ? Also, I don't think it is good to have messages in static util methods. Costin > > RCS file: > /home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/util/WARUtil.java > ,v > retrieving revision 1.1.1.1 > diff -r1.1.1.1 WARUtil.java > 72a73 > > import java.io.FileNotFoundException; > 80a82,87 > > > > /** > > * The string manager for this package. > > */ > > private static StringManager sm = > StringManager.getManager(Constants.Package); > > > 84,90c91,97 > < URL u = new URL(s); > < ZipInputStream zis = new ZipInputStream(u.openStream()); > < ZipEntry ze = null; > < > < while ((ze = zis.getNextEntry()) != null) { > < File f = new File(dir, ze.getName()); > < > --- > > URL u = new URL(s); > > ZipInputStream zis = new ZipInputStream(u.openStream()); > > ZipEntry ze = null; > > > > while ((ze = zis.getNextEntry()) != null) { > > File f = new File(dir, ze.getName()); > > try { > 93,104c100,113 > < } else { > < byte[] buffer = new byte[1024]; > < int length = 0; > < FileOutputStream fos = new FileOutputStream(f); > < > < while ((length = zis.read(buffer)) >= 0) { > < fos.write(buffer, 0, length); > < } > < > < fos.close(); > < } > < } > --- > > } else { > > byte[] buffer = new byte[1024]; > > int length = 0; > > FileOutputStream fos = new FileOutputStream(f); > > > > while ((length = zis.read(buffer)) >= 0) { > > fos.write(buffer, 0, length); > > } > > fos.close(); > > } > > } catch (FileNotFoundException fnfe) { > > System.out.println( sm.getString("WARUtil.filenotfound", > ze.getName(), s ) ); > > } > > } > 106c115 > < zis.close(); > --- > > zis.close(); > 110,116c119,125 > < if (s.startsWith(t)) { > < s = s.substring(t.length()); > < } > < > < if (s.endsWith(t)) { > < s = s.substring(0, s.length() - t.length()); > < } > --- > > if (s.startsWith(t)) { > > s = s.substring(t.length()); > > } > > > > if (s.endsWith(t)) { > > s = s.substring(0, s.length() - t.length()); > > }