Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8287843 File::getCanonicalFile doesn't work for \\?\C:\ style paths DOS device paths
  3. JDK-8320371

Release Note: `java.io.File` Drops the Windows Long Path Prefix from Path Strings

    XMLWordPrintable

Details

    Description

      On Windows, `java.io.File` has changed in this release such that creating a `File` from a path string with a long path prefix (`\\\\?\\` or `\\\\?\\UNC`) will now strip the prefix. This change fixes several anomalies with file path parsing, helps with interoperability with native code when the file path comes from a native program that includes the long path prefix, and also allows methods such as `File::getCanonicalFile` to return the canonical file from input that initially contained a long path prefix. The change to `java.io.File` aligns the behavior with the newer API `java.nio.file.Path`.

      The change may be observable to code that depends on `File::toString` returning a String that has the long path prefix.

      This change has no impact to file access, the JDK will continue to use the long path prefix when accessing files that need the prefix.

      Attachments

        Activity

          People

            alanb Alan Bateman
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: