CHAPTER 22: The Package java.io Previous
Previous
Java Language
Java Language
Index
Index
Next
Next

22.25 The Interface java.io.FilenameFilter

22.25.1 accept

The list method (S22.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 accept

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 (S22.24.26) of class File.

© 1996 Sun Microsystems, Inc. All rights reserved.