Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-693

FileUtils.deleteDirectory & PathUtils.deleteDirectory are behaving differently

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.9.0
    • Component/s: Utilities
    • Labels:
      None

      Description

      1. With the newly added PathUtils, the behavior of FileUtils.deleteDirectory has changed. Now nio is used instead of the old File.delete. The problem is, nio does not delete files with read only attribute and failes instead.
      2. The interface of FileUtils was not extended to provide the possibility to use a DeleteOption, so I guess, if someone wants to remove "all" files, then PathUtils should be used. But here comes the next problem, FileUtils.deleteDirectory checks for the existence (in opposite to its javadoc), where PathUtils.deleteDirectory does not. Thats very inconsistent.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              xpyrus Robert Seidel
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: