You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/01/28 01:15:24 UTC

[GitHub] [commons-io] garydgregory commented on a change in pull request #193: [IO-708] Refactor o.a.c.io.FileUtils to NIO

garydgregory commented on a change in pull request #193:
URL: https://github.com/apache/commons-io/pull/193#discussion_r565750297



##########
File path: src/main/java/org/apache/commons/io/FileUtils.java
##########
@@ -1838,6 +1841,36 @@ public static boolean isSymlink(final File file) {
         return file != null ? Files.isSymbolicLink(file.toPath()) : false;
     }
 
+    /**
+     * Tests whether the specified file is an actual file.
+     * <p>
+     * This method delegates to {@link Files#isRegularFile(Path, LinkOption...)}
+     * </p>
+     *
+     * @param file the file to test.
+     * @return true if the file is a regular file, see {@link Files#isRegularFile(Path, LinkOption...)}.
+     * @since 2.9
+     * @see Files#isRegularFile(Path, LinkOption...)
+     */
+    public static boolean isRegularFile(final File file) {

Review comment:
       If you want to do this kind of rework, add "primitive" methods to PathUtils and then have this method just pass the call forward with the File#toPath() result. The PathUtils method then just becomes a null-safe version of the underlying JRE Files API.




----------------------------------------------------------------
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:
users@infra.apache.org