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.
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.
- csr for
-
JDK-8302016 (fs) Path.of should allow input to include long path prefix
-
- Closed
-
- relates to
-
JDK-8233294 (fs) Add support for file paths that are DOS device paths or GUIDs
-
- Closed
-