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

Deletion of orphaned Softlinks does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.3.2
    • 1.4
    • None
    • None
    • Debian Linux JDK 1.5

    Description

      If there is an orphaned softlink a -> b, but b does not exists anymore than the softlink will not be removed. This happens when you call FileUtils.deleteDirectory() and when the linked target b is deleted earlier than the link.

      This is caused by the "ugly" file.exists() call in forceDelete()

      if (!file.exists()) {
      throw new FileNotFoundException("File does not exist: " + file);
      }

      if this check is not done, everything works as expected. I think this test is not neccessery, cause file.delete will test this better.

      Please discuss and change this.

      thanx

      Stefan

      Attachments

        1. FileUtils.patch
          2 kB
          Sebb

        Activity

          People

            niallp Niall Pemberton
            lischke Stefan Lischke
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: