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
public class FilenameExtensionFilter extends FileFilter implements FilenameFilter
This class will implement a FilenameFilter that filters on the extension of files.
- Author:
- Lennart Martens
-
Constructor Summary
Constructors Constructor Description FilenameExtensionFilter()
Empty 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:
accept
in interfaceFilenameFilter
- Parameters:
dir
- the directory in which the file was found.name
- the name of the file.- Returns:
true
if and only if the name should be included in the file list;false
otherwise.
-
accept
- Specified by:
accept
in classFileFilter
-
getDescription
- Specified by:
getDescription
in classFileFilter
-