Package org.apache.commons.vfs2
Class FileFilterSelector
- java.lang.Object
-
- org.apache.commons.vfs2.FileDepthSelector
-
- org.apache.commons.vfs2.FileFilterSelector
-
- All Implemented Interfaces:
FileSelector
public class FileFilterSelector extends FileDepthSelector
AFileSelector
that selects all children of the given fileObject.This is to mimic the
FileFilter
interface.
-
-
Constructor Summary
Constructors Constructor Description FileFilterSelector()
Constructs a new instance without a FileFilter.FileFilterSelector(FileFilter fileFilter)
Constructs a new instance with a FileFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(FileSelectInfo fileInfo)
Determines whether the file should be selected.boolean
includeFile(FileSelectInfo fileInfo)
Determines if a file or folder should be selected.-
Methods inherited from class org.apache.commons.vfs2.FileDepthSelector
traverseDescendents
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.vfs2.FileSelector
traverseDescendants
-
-
-
-
Constructor Detail
-
FileFilterSelector
public FileFilterSelector()
Constructs a new instance without a FileFilter.
-
FileFilterSelector
public FileFilterSelector(FileFilter fileFilter)
Constructs a new instance with a FileFilter.- Parameters:
fileFilter
- the FileFilter.
-
-
Method Detail
-
accept
public boolean accept(FileSelectInfo fileInfo) throws java.lang.Exception
Determines whether the file should be selected.- Parameters:
fileInfo
- The file selection information.- Returns:
- true if the file should be selected, false otherwise.
- Throws:
java.lang.Exception
- Thrown for file system errors or illegal argument exception.
-
includeFile
public boolean includeFile(FileSelectInfo fileInfo) throws java.lang.Exception
Determines if a file or folder should be selected.- Specified by:
includeFile
in interfaceFileSelector
- Overrides:
includeFile
in classFileDepthSelector
- Parameters:
fileInfo
- The file selection information.- Returns:
- true if the file or folder should be included, false otherwise.
- Throws:
java.lang.Exception
- if an error occurs.
-
-