ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types ZipScanner.java
Date Fri, 24 Jan 2003 13:45:50 GMT
bodewig     2003/01/24 05:45:49

  Modified:    src/main/org/apache/tools/ant/types ZipScanner.java
  Log:
  handle some directory cases in ZipScanner
  
  Revision  Changes    Path
  1.10      +9 -1      jakarta-ant/src/main/org/apache/tools/ant/types/ZipScanner.java
  
  Index: ZipScanner.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/ZipScanner.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ZipScanner.java	24 Jan 2003 13:28:46 -0000	1.9
  +++ ZipScanner.java	24 Jan 2003 13:45:49 -0000	1.10
  @@ -249,11 +249,19 @@
        * @since Ant 1.5.2
        */
       public Resource getResource(String name) {
  +        if (srcFile == null) {
  +            return super.getResource(name);
  +        } else if (name.equals("")) {
  +            // special case in ZIPs, we do not want this thing included
  +            return new Resource("", true, Long.MAX_VALUE, true);
  +        }
  +        
           // first check if the archive needs to be scanned again
           scanme();
           for (int counter = 0; counter < myentries.size(); counter++) {
               Resource myresource=(Resource)myentries.elementAt(counter);
  -            if (myresource.getName().equals(name)) {
  +            if (myresource.getName().equals(name)
  +                || myresource.getName().equals(name + "/")) {
                   return myresource;
               }
           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message