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

(fs) Path.of should allow input to include long path prefix

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 21
    • None
    • core-libs
    • None
    • b09

      We periodically see cases where the path string provided to Path.of includes the long path \\?\ or \\?\UNC prefix. This can arise with strings provided by a native application.

      The JDK will automatically add the prefix when accessing a file with a long path so the prefix is not needed; it is otherwise is out of sight and not something exposed to Java code. At this time, if code calls Path.of with a string that has this prefix then the input will be rejected. We should consider changing this to allow the input, adjust the prefix, and don't parse or retain it.

            bpb Brian Burkhalter
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: