Name: el35337 Date: 03/27/98
import java.io.*;
public class FileParentBug {
/**
* Demonstrate that File.getParent fails on directories with a trailing
* File.separator.
*
* Tested on JDK 1.1.5 and 1.2beta2 running on Solaris 2.5.1
*/
public static void main(String[] args) {
File file = new File("/u/test/");
System.out.println("The parent directory of /u/test/ should be /u (or /u/)")
;
System.out.println("JDK reports it as : " + file.getParent());
}
}
(Review ID: 27268)
======================================================================
- duplicates
-
JDK-4125993 java.io.File.getParent does not allow for trailing separator
-
- Closed
-
- relates to
-
JDK-4131169 java.io.File: Respecify using abstract pathnames rather than strings
-
- Closed
-