public File getLastFile ( ) throws FileNotFoundException { File [ ] files = directory . listFiles ( filter ) ; if ( files == null || files . length == 0 ) { throw new FileNotFoundException ( ) ; } return files [ files . length - 1 ] ; }
Returns the last matching file .