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);
    }
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.

@param dir Dir to look in.
@param prefix Basename of files to look for. Compare is case insensitive.

@return List of files in dir that start w/ passed basename.