de.jstacs.io
Class SubstringFilenameFilter
java.lang.Object
javax.swing.filechooser.FileFilter
de.jstacs.io.SubstringFilenameFilter
- All Implemented Interfaces:
- FileFilter, FilenameFilter
public class SubstringFilenameFilter
- extends FileFilter
- implements FileFilter, FilenameFilter
A simple filter on Files that accepts Files with a specific
substring in the filename.
- Author:
- Jens Keilwagen
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SubstringFilenameFilter
public SubstringFilenameFilter(SubstringFilenameFilter.PartOfName type,
String desc,
boolean dir,
boolean ignoreCase,
String... substring)
- Creates a new
SubstringFilenameFilter with given
substring(s) of type type to be found in the
filename of the Files to be filtered.
- Parameters:
type - the type of the substring that will be searcheddesc - the description of the filter, e.g. "text-files
(*.txt)"dir - a switch that allows directories to be acceptedignoreCase - indicates whether to ignore the case of the filenames or notsubstring - an array of substrings, at least one substring has to be found
as specific part (type) of the filename so that a
"real" File will be accepted
accept
public boolean accept(File arg0)
- Specified by:
accept in interface FileFilter- Specified by:
accept in class FileFilter
accept
public boolean accept(File dir,
String name)
- Specified by:
accept in interface FilenameFilter
getDescription
public String getDescription()
- Specified by:
getDescription in class FileFilter