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

(fs) Add support for file paths that are DOS device paths or GUIDs

    XMLWordPrintable

Details

    • x86_64
    • windows_10

    Description

      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


      Attachments

        Issue Links

          Activity

            People

              bpb Brian Burkhalter
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: