You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/01/15 10:57:00 UTC

[jira] [Work logged] (IO-702) FileUtils.forceDelete does not delete invalid links

     [ https://issues.apache.org/jira/browse/IO-702?focusedWorklogId=536425&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-536425 ]

ASF GitHub Bot logged work on IO-702:
-------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Jan/21 10:56
            Start Date: 15/Jan/21 10:56
    Worklog Time Spent: 10m 
      Work Description: boris-unckel opened a new pull request #187:
URL: https://github.com/apache/commons-io/pull/187


   …and fix of check.
   Testcase and first fix for [https://issues.apache.org/jira/browse/IO-702](https://issues.apache.org/jira/browse/IO-702)


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


Issue Time Tracking
-------------------

            Worklog Id:     (was: 536425)
    Remaining Estimate: 0h
            Time Spent: 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: 10m
>  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)