|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.io.FileExtensionFilter
public class FileExtensionFilter
A file filter that accepts all base files with a suffix with a
specified value or one of a set of specified values. The
extensions are specified in the constructor, and the filter may be
set to accept or reject directories. A file is tested by name
against String.endsWith(String).
| Constructor Summary | |
|---|---|
FileExtensionFilter(String extension)
Create a file filter that accepts files with the specified extension and accepts all directories. |
|
FileExtensionFilter(String[] extensions)
Create a file filter that accepts files with the specified extensions and accepts all directories. |
|
FileExtensionFilter(String[] extensions,
boolean acceptDirectories)
Create a file filter that accepts files with the specified extensions, optionally accepting directories. |
|
FileExtensionFilter(String extension,
boolean acceptDirectories)
Create a file filter that accepts files with the specified extension, optionally accepting directories. |
|
| Method Summary | |
|---|---|
boolean |
accept(File pathName)
Return true if the specified file has an
an acceptable suffix as specified in the constructor. |
protected boolean |
accept(String fileName)
Returns true if the specified file name has
an acceptable suffix as specified in the constructor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileExtensionFilter(String[] extensions,
boolean acceptDirectories)
extensions - Suffixes of files to accept.acceptDirectories - true if all directories
should be accepted by this filter.
public FileExtensionFilter(String extension,
boolean acceptDirectories)
extension - Suffix of files to accept.acceptDirectories - true if all directories
should be accepted by this filter.public FileExtensionFilter(String extension)
extension - Suffix of files to accept.public FileExtensionFilter(String[] extensions)
extensions - Suffixes of files to accept.| Method Detail |
|---|
protected final boolean accept(String fileName)
true if the specified file name has
an acceptable suffix as specified in the constructor.
fileName - Name of file to test for acceptance.
true If file name is acceptable.public boolean accept(File pathName)
true if the specified file has an
an acceptable suffix as specified in the constructor.
accept in interface FileFilterpathName - File to test for acceptance.
true If file's name is acceptable.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||