From e0459e7ba70ebf4f9031e638018a0c52f054ba2a Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 24 Jan 2003 13:45:49 +0000 Subject: [PATCH] handle some directory cases in ZipScanner git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273873 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/types/ZipScanner.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/types/ZipScanner.java b/src/main/org/apache/tools/ant/types/ZipScanner.java index 0151f7a86..774135eb2 100644 --- a/src/main/org/apache/tools/ant/types/ZipScanner.java +++ b/src/main/org/apache/tools/ant/types/ZipScanner.java @@ -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; } }