// R E L A T I V E  _  N A M E
// current directory is E:\genus
// The file is called E:\genus\species\rabbit.html, lower case.

File f = new File( "species/RABBIT.HTML" );

// prints species\RABBIT.HTML
out.println( f.toString() );

// prints E:\genus\species\RABBIT.HTML
out.println( f.getAbsolutePath() );

// prints RABBIT.HTML
out.println( f.getName() );

// prints species\RABBIT.HTML
out.println( f.getPath() );

// prints species
out.println( f.getParent() );

// prints E:\genus\species\rabbit.html
out.println( f.getCanonicalPath() );

// extension
String fs = f.toString();
int place = f.lastIndexOf( '.' );
if ( place >= 0 )
   {
   out.println( f.substring( place + 1 ) );
   }

// A B S O L U T E  _ N A M E
f = new File( "E:\\genus\\species\\RABBIT.HTML" );

// prints E:\genus\species\RABBIT.HTML
out.println( f.toString() );

// prints E:\genus\species\RABBIT.HTML
out.println( f.getAbsolutePath() );

// prints RABBIT.HTML
out.println( f.getName() );

// prints E:\genus\species\RABBIT.HTML
out.println( f.getPath() );

// prints E:\genus\species
out.println( f.getParent() );

// prints E:\genus\species\rabbit.html
out.println( f.getCanonicalPath() );

// R E L A T I V E  _ N A M E _ W I T H _ D R I V E
f = new File( "E:species\\RABBIT.HTML" );

// prints E:species\RABBIT.HTML
out.println( f.toString() );

// prints E:\genus\species\RABBIT.HTML
out.println( f.getAbsolutePath() );

// prints RABBIT.HTML
out.println( f.getName() );

// prints E:species\RABBIT.HTML
out.println( f.getPath() );

// prints E:species
out.println( f.getParent() );

// prints E:\genus\species\rabbit.html
out.println( f.getCanonicalPath() );