Browse Source

handle some directory cases in ZipScanner

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273873 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
e0459e7ba7
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      src/main/org/apache/tools/ant/types/ZipScanner.java

+ 9
- 1
src/main/org/apache/tools/ant/types/ZipScanner.java View File

@@ -249,11 +249,19 @@ public class ZipScanner extends DirectoryScanner {
* @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;
}
}


Loading…
Cancel
Save