Java Reference
In-Depth Information
returns
true
. For our
accept
method,
true
means that the named file is a
directory.
The
FileFilter
interface is analogous to
FilenameFilter
, but works with a
single
File
object:
boolean
accept(File pathname)
Returns
true
if the file represented by
pathname
should be part
of the filtered output.
Exercise 20.11
: Using
FilenameFilter
or
FileFilter
, write a program
that takes a directory and a suffix as parameters and prints all files it
can find that have that suffix.