|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lava.io.WildcardFilenameFilter
Filters filenames using a standard wildcard mask.
Details: WildcardFilenameFilter
tests filenames to determine their membership in the group of filenames defined by a wildcard expression. The characters '?' and '*' take on their usual meanings; '?' means "any character" and '*' means "any string of zero or more characters."
Note that in this implementation, the wildcards may be used to match the platform's directory separator characters, so care should be taken to avoid this effect if it is not desired.
Constructor Summary | |
WildcardFilenameFilter(java.lang.String mask)
Initializes a WildcardFilenameFilter using the given wildcard expression. |
|
WildcardFilenameFilter(java.lang.String mask,
java.lang.String file_separators)
Reserved for future implementation. |
Method Summary | |
boolean |
accept(java.io.File dir,
java.lang.String filename)
Determines if the given filename matches the expression associated with this FilenameFilter . |
static java.lang.String |
normalizeMask(java.lang.String mask)
Normalizes the filename mask. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WildcardFilenameFilter(java.lang.String mask, java.lang.String file_separators)
mask
- the filename maskfile_separators
- a list of characters that should not be allowed to match '*' or '?'public WildcardFilenameFilter(java.lang.String mask)
mask
- the wildcard expressionMethod Detail |
public boolean accept(java.io.File dir, java.lang.String filename)
FilenameFilter
. The dir
parameter is reserved for future use, and should be set to null
to ensure compatibility with future releases of this class.accept
in interface java.io.FilenameFilter
dir
- ignored, set to null
filename
- the filename to testtrue
if the filename passes, false
otherwisepublic static java.lang.String normalizeMask(java.lang.String mask)
Details: normalizeMask
normalizes the given mask into a form suitable for filename comparison on the host platform. This means, in particular, that if the operating system does not support case-sensitive filename differentiation (as is the case with Windows and Mac), that the mask characters are converted to upper case. On a Unix-style operating system, the original value is returned because upper and lower case distinctions are significant.
If the mask is null, null is returned.
mask
- the mask to adjust
|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |