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]