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