From a202ce4f88421e701923b8ee29781de3d652dc5f Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 25 Apr 2001 14:12:14 +0000 Subject: [PATCH] Use current time instead of something illegal when we don't know the last modification time of a dir. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268968 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Zip.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Zip.java b/src/main/org/apache/tools/ant/taskdefs/Zip.java index 2d245dbad..7a63bf4e2 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Zip.java +++ b/src/main/org/apache/tools/ant/taskdefs/Zip.java @@ -413,7 +413,11 @@ public class Zip extends MatchingTask { addedDirs.put(vPath, vPath); ZipEntry ze = new ZipEntry (vPath); - if (dir != null) ze.setTime (dir.lastModified ()); + if (dir != null && dir.exists()) { + ze.setTime(dir.lastModified()); + } else { + ze.setTime(System.currentTimeMillis()); + } ze.setSize (0); ze.setMethod (ZipEntry.STORED); // This is faintly ridiculous: