JDK-4141855 : java.io.File.getName can return more than file name
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.1.5
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-05-26
  • Updated: 1998-05-26
  • Resolved: 1998-05-26
Related Reports
Duplicate :  
Description

Name: diC59631			Date: 05/26/98


Call to File.getName() returns the full pathname
and not only the pure filename.

Try this

File f = new File("a/b/c");
System.out.println(f.getName());

on Solaris this is fine. on win32 jdk1.1.6 you will get "a/b/c" NOT just "c" as it should 

(Review ID: 27146)
======================================================================

Comments
EVALUATION Fixed in 1.2beta4 as part of the general rewrite of java.io.File. -- mr@eng 5/26/1998
26-05-1998