net.groboclown.util.io.v1
Class ExtensionFileFilter
java.lang.Object
|
+--net.groboclown.util.io.v1.ExtensionFilenameFilter
|
+--net.groboclown.util.io.v1.ExtensionFileFilter
- All Implemented Interfaces:
- FileFilter, FilenameFilter
- public class ExtensionFileFilter
- extends ExtensionFilenameFilter
- implements FileFilter
Allows files with the given extention(s) to be accepted. You can also
specify whether directories are allowed or not. This filter is
case insensitive or sensitive, depending on the settings.
The extension strings passed in are the end-of-name Strings, meaning
that each file must match at least one given string at the end. So,
if you want to match all "DOC" files, pass in ".doc" to match.
By default, directories are allowed, independent of their names. If
directories are not allowed, then the directory names must match the
extension list.
|
Method Summary |
boolean |
accept(File pathname)
Accepts all files. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
ExtensionFileFilter
public ExtensionFileFilter()
- Default Constructor.
ExtensionFileFilter
public ExtensionFileFilter(String extension)
- Specify a single "end string" to match.
ExtensionFileFilter
public ExtensionFileFilter(String[] exts)
Slow, but it works.
ExtensionFileFilter
public ExtensionFileFilter(boolean caseInsensitive)
ExtensionFileFilter
public ExtensionFileFilter(String extension,
boolean caseInsensitive)
ExtensionFileFilter
public ExtensionFileFilter(String[] exts,
boolean caseInsensitive)
accept
public boolean accept(File pathname)
- Accepts all files.
- Specified by:
accept in interface FileFilter- Overrides:
accept in class ExtensionFilenameFilter
Written under the LGPL