public static File [ ] getFilesWithPrefix ( File dir , final String prefix ) { FileFilter prefixFilter = new FileFilter ( ) { public boolean accept ( File pathname ) { return pathname . getName ( ) . toLowerCase ( ) . startsWith ( prefix . toLowerCase ( ) ) ; } } ; return dir . listFiles ( prefixFilter ) ; }
Get a list of all files in directory that have passed prefix .