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:
[email protected]