22.25 The Interface java.io.FilenameFilter

The list method (§22.24.26) of class File requires, as an argument, an object that implements the FilenameFilter interface. The only purpose of such an object is to provide a method accept that decides which files should appear in the generated directory listing.

public interface FilenameFilter {
	public boolean accept(File dir, String name);
}

22.25.1 public boolean accept(File dir, String name)

This method should return true if and only if the given file named name in the directory dir is to appear in the final list of files generated by the list method (§22.24.26) of class File.