Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8208355

Files."really"Delete

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 9
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:
      None

      Description

      The existing method Files.delete does not guarantee synchronous behavior, meaning that on some platforms (i.e. Windows) the file may not have been deleted by the time the method returns.

      For code that relies on the deletion taking place in a timely manner (i.e before proceeding into code that presumes the non-existence of the file in question) this means such code must make sure to pause until it can be verified that the file no longer exists. This code can be tricky to write and get right. (Notice the subtle difference between Files.exists and Files.notExists)

      It would help to have a standard convenience method available that provides synchronous deletion of a file system object.

      It would further help if there was a method to delete the contents of a directory before deleting the directory itself.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bpb Brian Burkhalter
              Reporter:
              jjg Jonathan Gibbons
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: