Package org.apache.commons.vfs2.filter
Class FileFileFilter
- java.lang.Object
-
- org.apache.commons.vfs2.filter.FileFileFilter
-
- All Implemented Interfaces:
java.io.Serializable
,FileFilter
public class FileFileFilter extends java.lang.Object implements FileFilter, java.io.Serializable
This filter acceptsFile
s that are files (not directories).For example, here is how to print out a list of the real files within the current directory:
FileSystemManager fsManager = VFS.getManager(); FileObject dir = fsManager.toFileObject(new File(".")); FileObject[] files = dir.findFiles(new FileFilterSelector(FileFileFilter.FILE)); for (int i = 0; i < files.length; i++) { System.out.println(files[i]); }
- Since:
- 2.4
- See Also:
- "http://commons.apache.org/proper/commons-io/", Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static FileFilter
FILE
Singleton instance of file filter.private static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileFileFilter()
Restrictive constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(FileSelectInfo fileSelectInfo)
Checks to see if the file is a file.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
FILE
public static final FileFilter FILE
Singleton instance of file filter.
-
-
Method Detail
-
accept
public boolean accept(FileSelectInfo fileSelectInfo) throws FileSystemException
Checks to see if the file is a file.- Specified by:
accept
in interfaceFileFilter
- Parameters:
fileSelectInfo
- the File to check- Returns:
- true if the file is a file
- Throws:
FileSystemException
- Thrown for file system errors.
-
-