Isira-Seneviratne commented on a change in pull request #124:
URL: https://github.com/apache/commons-io/pull/124#discussion_r467672456
##########
File path: src/main/java/org/apache/commons/io/FileUtils.java
##########
@@ -1603,93 +1598,272 @@ public static boolean isFileNewer(final File file,
final File reference) {
}
/**
- * Tests if the specified <code>File</code> is newer than the specified
- * time reference.
+ * Tests if the specified {@code File} is newer than the specified time
reference.
*
- * @param file the <code>File</code> of which the modification date
must
- * be compared, must not be {@code null}
+ * @param file the {@code File} of which the modification date must
be compared
* @param timeMillis the time reference measured in milliseconds since the
* epoch (00:00:00 GMT, January 1, 1970)
- * @return true if the <code>File</code> exists and has been modified after
- * the given time reference.
- * @throws IllegalArgumentException if the file is {@code null}
+ * @return true if the {@code File} exists and has been modified after the
given time reference.
+ * @throws NullPointerException if the file is {@code null}
*/
public static boolean isFileNewer(final File file, final long timeMillis) {
- if (file == null) {
- throw new IllegalArgumentException("No specified file");
- }
+ Objects.requireNonNull(file, "file");
if (!file.exists()) {
return false;
}
return file.lastModified() > timeMillis;
}
/**
- * Tests if the specified <code>File</code> is older than the specified
- * <code>Date</code>.
+ * Tests if the specified {@code File} is newer than the specified {@code
Instant}.
+ *
+ * @param file the {@code File} of which the modification date must be
compared
+ * @param instant the date reference
+ * @return true if the {@code File} exists and has been modified after the
given {@code Instant}.
+ * @throws NullPointerException if the file or instant is {@code null}
+ *
+ * @since 2.8
+ */
+ public static boolean isFileNewer(final File file, final Instant instant) {
Review comment:
@garydgregory My bad, I'll do so now.
@chtompki How should the conversion be done?
----------------------------------------------------------------
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]