[
https://issues.apache.org/jira/browse/IO-676?focusedWorklogId=457852&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-457852
]
ASF GitHub Bot logged work on IO-676:
-------------------------------------
Author: ASF GitHub Bot
Created on: 13/Jul/20 03:54
Start Date: 13/Jul/20 03:54
Worklog Time Spent: 10m
Work Description: Isira-Seneviratne commented on a change in pull request
#124:
URL: https://github.com/apache/commons-io/pull/124#discussion_r453421318
##########
File path: src/main/java/org/apache/commons/io/FileUtils.java
##########
@@ -1690,6 +1810,119 @@ public static boolean isFileOlder(final File file,
final long timeMillis) {
return file.lastModified() < timeMillis;
}
+ /**
+ * Tests if the specified <code>File</code> is older than the specified
+ * <code>Instant</code>.
+ *
+ * @param file the <code>File</code> of which the modification date
+ * must be compared, must not be {@code null}
+ * @param instant the date reference, must not be {@code null}
+ * @return true if the <code>File</code> exists and has been modified
+ * before the given <code>Instant</code>.
+ * @throws IllegalArgumentException if the file or instant is {@code null}
+ */
+ public static boolean isFileOlder(final File file, final Instant instant) {
+ if (instant == null) {
Review comment:
Maybe the other methods could be updated to use `Objects.requireNonNull`
as well in a separate PR?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 457852)
Time Spent: 50m (was: 40m)
> Add isFileNewer() and isFileOlder() methods that support the Java 8 Date/Time
> API.
> ----------------------------------------------------------------------------------
>
> Key: IO-676
> URL: https://issues.apache.org/jira/browse/IO-676
> Project: Commons IO
> Issue Type: Improvement
> Components: Utilities
> Reporter: Isira Seneviratne
> Priority: Major
> Fix For: 2.8
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)