public class WindowsLikeFilenameFilter extends Object implements FilenameFilter
Constructor and Description |
---|
WindowsLikeFilenameFilter(String filter)
Creates the instance of the file name filter that is case sensitive.
|
WindowsLikeFilenameFilter(String filter,
boolean isCaseSensitive)
Creates the instance of the file name filter that is case sensitive.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(File dir,
String name)
Tests if a specified file should be included in a file list with
the current filter.
|
boolean |
getCaseSensitivity()
Gets the case sensitivity flag.
|
String |
getFilter()
Gets the current filter string.
|
static boolean |
isMatching(String name,
String filter)
Checks if a name matches a filter string like under Windows, with '?'
being any character, '*' being any characters and '^' the escape character
(the meaning of '?' and '*' becomes the actual character, and two escape
characters for a single).
|
static boolean |
isMatching(String name,
String filter,
boolean isCaseSensitive)
Checks if a name matches a filter string like under Windows, with '?'
being any character, '*' being any characters and '^' the escape character
(the meaning of '?' and '*' becomes the actual character, and two escape
characters for a single).
|
void |
setCaseSensitivity(boolean on)
Sets the case sensitivity flag.
|
void |
setFilter(String filter)
Sets a new filter string.
|
public WindowsLikeFilenameFilter(String filter)
filter
parameter to null will include all files.public WindowsLikeFilenameFilter(String filter, boolean isCaseSensitive)
filter
parameter to null will include all files.public void setFilter(String filter)
filter
parameter to null will include all files.public String getFilter()
public void setCaseSensitivity(boolean on)
public boolean getCaseSensitivity()
public boolean accept(File dir, String name)
accept
in interface FilenameFilter
dir
- - the directory in which the file was found.name
- - the name of the file.public static boolean isMatching(String name, String filter)
public static boolean isMatching(String name, String filter, boolean isCaseSensitive)
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.