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

Paths.get() doesn't support long UNC

XMLWordPrintable

    • x86
    • other

      FULL PRODUCT VERSION :
      java version "1.8.0_101"
      Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 2008 R2 x64

      A DESCRIPTION OF THE PROBLEM :
      Windows supports network paths of format:

      \\?\servername\sharename\path\filename.ext

      Paths.get() doesn't support those, throws InvalidPathException.


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "main" java.nio.file.InvalidPathException: Illegal character [?] in path at index 2: \\?\ai-fas6\valekseyev$\FlipCards\Other\Flips in ASF Order_March102011.pdf
      at sun.nio.fs.WindowsPathParser.nextSlash(Unknown Source)
      at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
      at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
      at sun.nio.fs.WindowsPath.parse(Unknown Source)
      at sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
      at java.nio.file.Paths.get(Unknown Source)
      at gov.nih.niaid.temp.Main.main(Main.java:62)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class Main
      {
      static public void main(String [] args)
      {
                  Path po = Paths.get("\\\\?\\ai-fas6\\valekseyev$\\FlipCards\\Other\\Flips in ASF Order_March102011.pdf");
                  //substitute your own network file
              }
      }


      ---------- END SOURCE ----------

            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: