diff options
author | Gary Gregory <gardgregory@gmail.com> | 2022-08-13 11:35:14 -0400 |
---|---|---|
committer | Gary Gregory <gardgregory@gmail.com> | 2022-08-13 11:35:14 -0400 |
commit | f22a4227401855ecbfdf8184bbe37275c3aeb5c3 (patch) | |
tree | 649622977cfd87acc8789498a214f5cab8ab5e2f /src/main/java/org | |
parent | fc1e53506ecb0f97b85034a8628eab31278824b4 (diff) | |
download | apache-commons-io-f22a4227401855ecbfdf8184bbe37275c3aeb5c3.tar.gz |
Fix new API and convert its tests to use fixed file times
The goal is to avoid the vagueries and randomness of local file systems
and operating systems.
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/apache/commons/io/FileUtils.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/apache/commons/io/FileUtils.java b/src/main/java/org/apache/commons/io/FileUtils.java index 0ce8e97e..156e5637 100644 --- a/src/main/java/org/apache/commons/io/FileUtils.java +++ b/src/main/java/org/apache/commons/io/FileUtils.java @@ -1522,7 +1522,7 @@ public class FileUtils { /** * Tests if the specified {@link File} is newer than the specified {@link ChronoLocalDate} - * at the current time. + * at the end of day. * * <p>Note: The input date is assumed to be in the system default time-zone with the time * part set to the current time. To use a non-default time-zone use the method @@ -1538,7 +1538,7 @@ public class FileUtils { * @since 2.8.0 */ public static boolean isFileNewer(final File file, final ChronoLocalDate chronoLocalDate) { - return isFileNewer(file, chronoLocalDate, LocalTime.now()); + return isFileNewer(file, chronoLocalDate, LocalTime.MAX); } /** @@ -1724,7 +1724,7 @@ public class FileUtils { /** * Tests if the specified {@link File} is older than the specified {@link ChronoLocalDate} - * at the current time. + * at the end of day. * * <p>Note: The input date is assumed to be in the system default time-zone with the time * part set to the current time. To use a non-default time-zone use the method @@ -1742,7 +1742,7 @@ public class FileUtils { * @since 2.8.0 */ public static boolean isFileOlder(final File file, final ChronoLocalDate chronoLocalDate) { - return isFileOlder(file, chronoLocalDate, LocalTime.now()); + return isFileOlder(file, chronoLocalDate, LocalTime.MAX); } /** |