tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@eng.sun.com
Subject Re: tomcat diffs
Date Mon, 01 Nov 1999 20:57:53 GMT
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());
> >     }


Mime
View raw message