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/27 20:41:44 UTC

[GitHub] [commons-io] boris-unckel opened a new pull request #193: [IO-708] Refactor o.a.c.io.FileUtils to NIO

boris-unckel opened a new pull request #193:
URL: https://github.com/apache/commons-io/pull/193


   Fixes https://issues.apache.org/jira/browse/IO-708


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
boris-unckel commented on pull request #193:
URL: https://github.com/apache/commons-io/pull/193#issuecomment-769817501


   Smaller refactorings startet here [https://github.com/apache/commons-io/commit/4caff5d7b7f114d3ca300abb76b6e275167794c6](https://github.com/apache/commons-io/commit/4caff5d7b7f114d3ca300abb76b6e275167794c6) and here [https://github.com/apache/commons-io/pull/196](https://github.com/apache/commons-io/pull/196)


----------------------------------------------------------------
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



[GitHub] [commons-io] boris-unckel closed pull request #193: [IO-708] Refactor o.a.c.io.FileUtils to NIO

Posted by GitBox <gi...@apache.org>.
boris-unckel closed pull request #193:
URL: https://github.com/apache/commons-io/pull/193


   


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #193:
URL: https://github.com/apache/commons-io/pull/193#discussion_r565755740



##########
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:
       IMO you could have a separate PR that only add "is" methods that cover the Files.is() APIs.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #193:
URL: https://github.com/apache/commons-io/pull/193#issuecomment-768829029


   
   [![Coverage Status](https://coveralls.io/builds/36656982/badge)](https://coveralls.io/builds/36656982)
   
   Coverage increased (+0.07%) to 89.016% when pulling **47d2bf550c8f00e580d1c6ea306b6ef95486a888 on boris-unckel:fileutil_nio** into **9ca232df5d0e5437b1a775f45c1f1c5183051a81 on apache:master**.
   


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
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