Release Note: java.io.File Treats the Empty Pathname As the Current User Directory

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Delivered
    • Priority: P4
    • 25
    • Affects Version/s: 25
    • Component/s: core-libs
    • generic
    • generic

      The `java.io.File` class is changed so that an instance of `File` created from the empty abstract pathname ("") now behaves consistently like a `File` created from the current user directory. Long standing behavior was for some methods to fail for the empty pathname. The change means that the `canRead`, `exists`, and `isDirectory` methods return `true` instead of failing with `false`, and the `getFreeSpace`, `lastModified`, and `length` methods return the expected values instead of zero. Methods such as `setReadable` and `setLastModified` will attempt to change the file's attributes instead of failing. WIth this change, `java.io.File` now matches the behavior of the `java.nio.file` API.

            Assignee:
            Brian Burkhalter
            Reporter:
            Brian Burkhalter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: