public abstract class AbstractFileFilter extends Object implements FileFilter
FileFilter
which provides common basic functionality for actual filter implementations.
Basic functionality means the capability to control whether to accept hidden files or directories in addition to the
non-hidden ones, as well as the actual check whether a File
-object is hidden or not.
Modifier and Type | Field and Description |
---|---|
protected boolean |
showHidden
Flag that defines whether to show hidden files and directories or not.
|
Constructor and Description |
---|
AbstractFileFilter(boolean showHidden) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
accept(File file) |
protected boolean |
isFileHidden(File file)
Check whether the file / directory is hidden or not.
|
boolean |
isShowHidden()
Returns the current state of the
showHidden -flag. |
void |
setShowHidden(boolean showHidden)
Enables to switch the behavior of the DirectoryFileFilter instance regarding whether to show hidden directories or
not.
|
protected boolean showHidden
public abstract boolean accept(File file)
accept
in interface FileFilter
protected boolean isFileHidden(File file)
file
- The File
-object to check.true
if hidden, false
otherwise.public boolean isShowHidden()
showHidden
-flag.showHidden
-flag.public void setShowHidden(boolean showHidden)
Enables to switch the behavior of the DirectoryFileFilter instance regarding whether to show hidden directories or not.
true
will enable the display of hidden directories.false
will enable the default behavior of not showing hidden directories.showHidden
- Defines whether to show hidden directories or not.Copyright © 2015. All Rights Reserved.