diff --git a/src/main/org/apache/tools/ant/taskdefs/Jar.java b/src/main/org/apache/tools/ant/taskdefs/Jar.java index 60273fa0a..c652e3e6d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Jar.java +++ b/src/main/org/apache/tools/ant/taskdefs/Jar.java @@ -90,7 +90,7 @@ public class Jar extends Zip { fs.setDir(new File(manifest.getParent())); fs.setIncludes(manifest.getName()); fs.setFullpath("META-INF/MANIFEST.MF"); - super.addFileset(fs); + super.addPrefixedfileset(fs); } diff --git a/src/main/org/apache/tools/ant/taskdefs/War.java b/src/main/org/apache/tools/ant/taskdefs/War.java index 6f3dea607..7f8b1cc5b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/War.java +++ b/src/main/org/apache/tools/ant/taskdefs/War.java @@ -91,25 +91,25 @@ public class War extends Jar { fs.setDir(new File(deploymentDescriptor.getParent())); fs.setIncludes(deploymentDescriptor.getName()); fs.setFullpath("WEB-INF/web.xml"); - super.addFileset(fs); + super.addPrefixedfileset(fs); } public void addLib(PrefixedFileSet fs) { // We just set the prefix for this fileset, and pass it up. fs.setPrefix("WEB-INF/lib/"); - super.addFileset(fs); + super.addPrefixedfileset(fs); } public void addClasses(PrefixedFileSet fs) { // We just set the prefix for this fileset, and pass it up. fs.setPrefix("WEB-INF/classes/"); - super.addFileset(fs); + super.addPrefixedfileset(fs); } public void addWebinf(PrefixedFileSet fs) { // We just set the prefix for this fileset, and pass it up. fs.setPrefix("WEB-INF/"); - super.addFileset(fs); + super.addPrefixedfileset(fs); } protected void initZipOutputStream(ZipOutputStream zOut) diff --git a/src/main/org/apache/tools/ant/taskdefs/Zip.java b/src/main/org/apache/tools/ant/taskdefs/Zip.java index 84fb19f6d..6f5d03753 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Zip.java +++ b/src/main/org/apache/tools/ant/taskdefs/Zip.java @@ -109,7 +109,7 @@ public class Zip extends MatchingTask { /** * Adds a set of files (nested fileset attribute). */ - public void addFileset(PrefixedFileSet set) { + public void addFileset(FileSet set) { filesets.addElement(set); } @@ -499,22 +499,28 @@ public class Zip extends MatchingTask { } /** - * Iterate over the given Vector of prefixedfilesets and add + * Iterate over the given Vector of (prefixed)filesets and add * all files to the ZipOutputStream using the given prefix. */ protected void addFiles(Vector filesets, ZipOutputStream zOut) throws IOException { // Add each fileset in the Vector. for (int i = 0; i 0 && !prefix.endsWith("/") && !prefix.endsWith("\\")) { prefix += "/"; } - String fullpath = fs.getFullpath(); // Need to manually add either fullpath's parent directory, or // the prefix directory, to the archive. if (prefix.length() > 0) { @@ -522,7 +528,7 @@ public class Zip extends MatchingTask { zipDir(null, zOut, prefix); } else if (fullpath.length() > 0) { addParentDirs(null, fullpath, zOut, ""); - } + } // Add the fileset. addFiles(ds, zOut, prefix, fullpath); }