public final class FileLengthFilter
extends java.lang.Object
implements java.io.FilenameFilter
Modifier and Type | Field and Description |
---|---|
static boolean |
LONG_FILES
convenience constant to remember that true means you want long files.
|
static boolean |
SHORT_FILES
convenience constant to help you remember that false means accept short files.
|
Constructor and Description |
---|
FileLengthFilter(long length,
boolean wantLongFiles)
constructor
|
public static boolean LONG_FILES
public static boolean SHORT_FILES
public FileLengthFilter(long length, boolean wantLongFiles)
length
- The length of file you want to accept.wantLongFiles
- true LONG_FILES if you want file longer or equal to the specified length. false SHORT_FILES
if you want filenames shorter or equal to the specified length.public boolean accept(java.io.File dir, java.lang.String name)
accept
in interface java.io.FilenameFilter
dir
- the directory in which the file was found.name
- the name of the filepublic static void main(java.lang.String[] args)
args
- not used