-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
13, 14
-
x86_64
-
windows_10
ADDITIONAL SYSTEM INFORMATION :
Windows 10
A DESCRIPTION OF THE PROBLEM :
sun.nio.fs.WindowsPathParser cannot correctly check the URI at the beginning of "\\.\".
When I forced sun.nio.fs.WindowsPathParser#isInvalidPathChar to return false, the target file was successfully generated.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
invoke: Files.createFile(Paths.get("\\\\.\\D:\\prn.xml"));
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no exception
ACTUAL -
Exception in thread "main" java.nio.file.InvalidPathException: Illegal character [:] in path at index 5: \\.\D:\prn.xml
at java.base/sun.nio.fs.WindowsPathParser.nextSlash(WindowsPathParser.java:212)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:116)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
---------- BEGIN SOURCE ----------
Files.createFile(Paths.get("\\\\.\\D:\\prn.xml"));
---------- END SOURCE ----------
FREQUENCY : always
Windows 10
A DESCRIPTION OF THE PROBLEM :
sun.nio.fs.WindowsPathParser cannot correctly check the URI at the beginning of "\\.\".
When I forced sun.nio.fs.WindowsPathParser#isInvalidPathChar to return false, the target file was successfully generated.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
invoke: Files.createFile(Paths.get("\\\\.\\D:\\prn.xml"));
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no exception
ACTUAL -
Exception in thread "main" java.nio.file.InvalidPathException: Illegal character [:] in path at index 5: \\.\D:\prn.xml
at java.base/sun.nio.fs.WindowsPathParser.nextSlash(WindowsPathParser.java:212)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:116)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
---------- BEGIN SOURCE ----------
Files.createFile(Paths.get("\\\\.\\D:\\prn.xml"));
---------- END SOURCE ----------
FREQUENCY : always
- relates to
-
JDK-8298478 (fs) Path.of should allow input to include long path prefix
-
- Resolved
-