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

java.io.File.getCanonicalPath fails for UNC paths

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • core-libs
    • x86
    • windows_nt



      Name: el35337 Date: 03/09/98


      java.io.File.getCanonicalPath reports a java.io.IOException
      if passed a UNC path name (e.g. \\galaxi\share\VT),
      even if the specified UNC path is fully valid. A simple
      test program its execution and results are included
      below.

      ------------- The test program -------------
      import java.io.File;
      import java.io.IOException;

      public class TF {
        static public void main(String argv[]) throws IOException {
          File f1 = new File(argv[0]);
          System.out.println("canonical path = " + f1.getCanonicalPath());
        }

      ------------- The execution and error -----------

      C:\java TF \\galaxi\share\VT
      java.io.IOException: bad path error
      at java.io.File.canonPath(Native Method)
      at java.io.File.getCanonicalPath(File.java:239)
      at TF.main(TF.java:7)
      (Review ID: 26125)
      ======================================================================

            Unassigned Unassigned
            elarsen Erik Larsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: