Browse Source

use the same timestamp for all files of nested filesets in <touch> if

no value has been specified.

PR: 2956
Submitted by:	richardwan@servidium.com (Richard F Wan)


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270109 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
2ffd04693b
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      src/main/org/apache/tools/ant/taskdefs/Touch.java

+ 7
- 6
src/main/org/apache/tools/ant/taskdefs/Touch.java View File

@@ -174,13 +174,18 @@ public class Touch extends Task {
location); location);
} }
} }
touch(file);
} }


if (millis >= 0 && project.getJavaVersion() == Project.JAVA_1_1) { if (millis >= 0 && project.getJavaVersion() == Project.JAVA_1_1) {
log("modification time of files cannot be set in JDK 1.1", log("modification time of files cannot be set in JDK 1.1",
Project.MSG_WARN); Project.MSG_WARN);
return; return;
} else {
millis = System.currentTimeMillis();
}

if (file != null) {
touch(file);
} }


// deal with the filesets // deal with the filesets
@@ -211,11 +216,7 @@ public class Touch extends Task {
return; return;
} }


if (millis < 0) {
fileUtils.setFileLastModified(file, System.currentTimeMillis());
} else {
fileUtils.setFileLastModified(file, millis);
}
fileUtils.setFileLastModified(file, millis);
} }


} }

Loading…
Cancel
Save