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/16 00:10:24 UTC

[GitHub] [commons-io] garydgregory commented on a change in pull request #187: IO-702 FileUtils.forceDelete does not delete invalid links. Testcase …

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



##########
File path: src/main/java/org/apache/commons/io/FileUtils.java
##########
@@ -309,6 +309,9 @@ public static void cleanDirectory(final File directory) throws IOException {
         if (!causeList.isEmpty()) {
             throw new IOExceptionList(causeList);
         }
+        if (listFiles(directory, null).length > 0) {

Review comment:
       Hi @boris-unckel 
   
   Thank you for your PR.
   
   That is an expensive way to test for emptiness if there are a lot of files. Please rebase on master and call `isEmptyDirectory(File)` in this class.
   
   TY.
   
   




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