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

FileUtils.deleteDirectory & PathUtils.deleteDirectory are behaving differently

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 2.9.0
    • Utilities
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: