public class SuffixFileFilter extends Object implements FileFilter, Serializable
For example, to retrieve and print all *.java files in the
current directory:
FileSystemManager fsManager = VFS.getManager();
FileObject dir = fsManager.toFileObject(new File("."));
FileObject[] files = dir.findFiles(new FileFilterSelector(new SuffixFileFilter(".java")));
for (int i = 0; i < files.length; i++) {
System.out.println(files[i]);
}
| Constructor and Description |
|---|
SuffixFileFilter(IOCase caseSensitivity,
List<String> suffixes)
Constructs a new Suffix file filter for a list of suffixes specifying
case-sensitivity.
|
SuffixFileFilter(IOCase caseSensitivity,
String... suffixes)
Constructs a new Suffix file filter for an array of suffixs specifying
case-sensitivity.
|
SuffixFileFilter(List<String> suffixes)
Constructs a new Suffix file filter for a list of suffixes.
|
SuffixFileFilter(String... suffixes)
Constructs a new Suffix file filter for an array of suffixes.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(FileSelectInfo fileSelectInfo)
Checks to see if the file name ends with the suffix.
|
String |
toString()
Provides a String representation of this file filter.
|
public SuffixFileFilter(List<String> suffixes)
suffixes - the suffixes to allow, must not be nullpublic SuffixFileFilter(IOCase caseSensitivity, List<String> suffixes)
suffixes - the suffixes to allow, must not be nullcaseSensitivity - how to handle case sensitivity, null means
case-sensitivepublic SuffixFileFilter(String... suffixes)
suffixes - the suffixes to allow, must not be nullpublic SuffixFileFilter(IOCase caseSensitivity, String... suffixes)
suffixes - the suffixes to allow, must not be nullcaseSensitivity - how to handle case sensitivity, null means
case-sensitivepublic boolean accept(FileSelectInfo fileSelectInfo)
accept in interface FileFilterfileSelectInfo - the File to checkCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.