private static File getMatchingFile ( File folder , FilenameFilter filter ) { File result = null ; final File [ ] matches = folder . listFiles ( filter ) ; if ( null != matches && 1 == matches . length ) { result = matches [ 0 ] ; } return result ; }
Returns a list of files that match the given filter this does not recursively scan the directory .