Contents
Class FileFileFilter
java.lang.Object
org.apache.commons.vfs2.filter.FileFileFilter
- All Implemented Interfaces:
Serializable
,FileFilter
This filter accepts
File
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
- Author:
- This code was originally ported from Apache Commons IO File Filter
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
accept
(FileSelectInfo fileSelectInfo) Checks to see if the file is a file.
-
Field Details
-
Constructor Details
-
FileFileFilter
protected FileFileFilter()Restrictive constructor.
-
-
Method Details
-
accept
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.
-