From db9a46b384c6d61bd31a473f3e8c3aa274e13415 Mon Sep 17 00:00:00 2001 From: Magesh Umasankar Date: Wed, 4 Dec 2002 15:31:18 +0000 Subject: [PATCH] The zip task doesn't work correctly if you're using filesetmanifest and update is false - Fix for this problem caused by previous patch. Submitted by: Brian Deitte git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273609 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/taskdefs/Zip.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Zip.java b/src/main/org/apache/tools/ant/taskdefs/Zip.java index 86cf7c0d2..3e597be4f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Zip.java +++ b/src/main/org/apache/tools/ant/taskdefs/Zip.java @@ -371,14 +371,18 @@ public class Zip extends MatchingTask { log(action + archiveType + ": " + zipFile.getAbsolutePath()); - ZipOutputStream zOut = - new ZipOutputStream(new FileOutputStream(zipFile)); - zOut.setEncoding(encoding); + ZipOutputStream zOut = null; try { - if (doCompress) { - zOut.setMethod(ZipOutputStream.DEFLATED); - } else { - zOut.setMethod(ZipOutputStream.STORED); + + if (! skipWriting) { + zOut = new ZipOutputStream(new FileOutputStream(zipFile)); + + zOut.setEncoding(encoding); + if (doCompress) { + zOut.setMethod(ZipOutputStream.DEFLATED); + } else { + zOut.setMethod(ZipOutputStream.STORED); + } } initZipOutputStream(zOut);