You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2026/03/27 13:28:00 UTC
[jira] [Updated] (IO-888) FileUtils cleanDirectory deletes all subdirectories and files, not just files.
[ https://issues.apache.org/jira/browse/IO-888?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory updated IO-888:
-------------------------------
Description:
This a follow up to IO-857.
There exists a difference between FileUtils and PathUtils in "clean directory" behavior.
Both classes provide "clean" and "delete" APIs.
In PathUtils, cleaning a directory, removes all files but leaves a the directory structure alone.
In FileUtils, cleaning actually deletes everything.
The question is whether FileUtils should be changed to only clean.
was:The PathUtils.cleanDirectory method does not erase subdirectories. Only the files in them. The FileUtils.cleanDirectory method erases everything except the directory itself, and this is the expected behavior.
> FileUtils cleanDirectory deletes all subdirectories and files, not just files.
> ------------------------------------------------------------------------------
>
> Key: IO-888
> URL: https://issues.apache.org/jira/browse/IO-888
> Project: Commons IO
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.16.1
> Reporter: Dmitry
> Priority: Minor
>
> This a follow up to IO-857.
> There exists a difference between FileUtils and PathUtils in "clean directory" behavior.
> Both classes provide "clean" and "delete" APIs.
> In PathUtils, cleaning a directory, removes all files but leaves a the directory structure alone.
> In FileUtils, cleaning actually deletes everything.
> The question is whether FileUtils should be changed to only clean.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)