JDK-4118024 : java.io.File.getCanonicalPath fails for UNC paths
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-03-09
  • Updated: 1998-03-09
  • Resolved: 1998-03-09
Related Reports
Duplicate :  
Description

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)
======================================================================