[
https://issues.apache.org/jira/browse/IO-702?focusedWorklogId=536433&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-536433
]
ASF GitHub Bot logged work on IO-702:
-------------------------------------
Author: ASF GitHub Bot
Created on: 15/Jan/21 11:24
Start Date: 15/Jan/21 11:24
Worklog Time Spent: 10m
Work Description: boris-unckel commented on pull request #187:
URL: https://github.com/apache/commons-io/pull/187#issuecomment-760885647
@garydgregory
The deleteDirectory story is still not final, but with different root cause.
Please review the testcase and first fix. Do you have an idea whats wrong with
forceDelete?
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 536433)
Time Spent: 20m (was: 10m)
> FileUtils.forceDelete does not delete invalid links
> ---------------------------------------------------
>
> Key: IO-702
> URL: https://issues.apache.org/jira/browse/IO-702
> Project: Commons IO
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.8.0
> Reporter: Boris Unckel
> Priority: Critical
> Time Spent: 20m
> Remaining Estimate: 0h
>
> The current implementation of FileUtils.forceDelete does not delete invalid
> links. Invalid links means one pointing to a non existing directory. This is
> _not related_ to the intended behaviour to _keep the destination_ of the link.
> The FileUtils.cleanDirectory is based on forceDelete but does not check the
> result. FileUtils.cleanDirectory assumes "no exception" means "directory is
> clean".
> FileUtils.deleteDirectory fails with "directory not empty".
> Testcase result (will provide that)
> {code:java}
> java.nio.file.DirectoryNotEmptyException:
> /tmp/junit4962570063696933090/realParentDirC
> at
> java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:246)
> at
> java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
> at java.base/java.nio.file.Files.delete(Files.java:1146)
> at org.apache.commons.io.FileUtils.delete(FileUtils.java:1173)
> at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1192)
> at
> org.apache.commons.io.FileUtilsDeleteDirectoryBaseTestCase.testDeleteInvalidLinks(FileUtilsDeleteDirectoryBaseTestCase.java:216)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)