Package com.compomics.util.io.file
Class FilenameExtensionFilter
java.lang.Object
javax.swing.filechooser.FileFilter
com.compomics.util.io.file.FilenameExtensionFilter
- All Implemented Interfaces:
FilenameFilter
This class will implement a FilenameFilter that filters on the extension of files.
- Author:
- Lennart Martens
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty default constructorFilenameExtensionFilter(String aExtension) This constructor takes an extension to filter on.FilenameExtensionFilter(String aExtension, String aDescription) This constructor takes an extension to filter on. -
Method Summary
-
Constructor Details
-
FilenameExtensionFilter
public FilenameExtensionFilter()Empty default constructor -
FilenameExtensionFilter
This constructor takes an extension to filter on. It doesn't care about a leading dot, so specifying '.class' is identical to 'class'.- Parameters:
aExtension- String with the extension to filter. Note that '.class' is identical to 'class'.
-
FilenameExtensionFilter
This constructor takes an extension to filter on. It doesn't care about a leading dot, so specifying '.class' is identical to 'class'.- Parameters:
aExtension- String with the extension to filter. Note that '.class' is identical to 'class'.aDescription- String with the description for the FileFilter. Can be null in which case the description will be an empty String.
-
-
Method Details
-
accept
Tests if a specified file should be included in a file list.- Specified by:
acceptin interfaceFilenameFilter- Parameters:
dir- the directory in which the file was found.name- the name of the file.- Returns:
trueif and only if the name should be included in the file list;falseotherwise.
-
accept
- Specified by:
acceptin classFileFilter
-
getDescription
- Specified by:
getDescriptionin classFileFilter
-