public final class FilenameLengthFilter
extends java.lang.Object
implements java.io.FilenameFilter
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUGGING
true if debugging.
|
static boolean |
LONG_FILENAMES
convenience constant to remember that true means you want long filenames.
|
static boolean |
SHORT_FILENAMES
convenience constant to help you remember that false means accept short names.
|
Constructor and Description |
---|
FilenameLengthFilter(int desiredLength,
boolean wantLongNames)
constructor
|
public static final boolean DEBUGGING
public static final boolean LONG_FILENAMES
public static final boolean SHORT_FILENAMES
public FilenameLengthFilter(int desiredLength, boolean wantLongNames)
desiredLength
- The length of filename you want to accept.wantLongNames
- true LONG_FILENAMES if you want filenames longer or equal to the specified length. false
SHORT_FILENAMES 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