public class RecursiveFileFilter
extends java.lang.Object
implements java.io.FilenameFilter
Constructor and Description |
---|
RecursiveFileFilter(boolean recursive,
boolean includeFiles,
boolean includeDirectories)
Construct a recursive file filter.
|
RecursiveFileFilter(boolean recursive,
boolean includeFiles,
boolean includeDirectories,
boolean filesOnly,
boolean directoriesOnly,
java.lang.String fileFilter)
Construct a recursive file filter.
|
RecursiveFileFilter(boolean recursive,
boolean includeFiles,
boolean includeDirectories,
boolean filesOnly,
boolean directoriesOnly,
java.lang.String fileFilter,
boolean escape)
Construct a recursive file filter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File dir,
java.lang.String name)
Return whether the file or directory name in the given directory is
accepted.
|
java.util.List<java.io.File> |
getFiles()
Return the list of all files and directories after the filtering.
|
static java.io.File[] |
listFiles(java.io.File directory,
boolean recursive,
boolean includeFiles,
boolean includeDirectories,
boolean filesOnly,
boolean directoriesOnly,
java.lang.String fileFilter)
List all the files and directories within the given directory.
|
static java.io.File[] |
listFiles(java.io.File directory,
boolean recursive,
boolean includeFiles,
boolean includeDirectories,
boolean filesOnly,
boolean directoriesOnly,
java.lang.String fileFilter,
boolean escape)
List all the files and directories within the given directory.
|
static java.io.File[] |
listFiles(java.io.File directory,
boolean recursive,
boolean includeFiles,
boolean includeDirectories,
java.lang.String fileFilter)
List all the files and directories within the given directory.
|
static java.io.File[] |
listFiles(java.io.File directory,
boolean recursive,
boolean includeFiles,
boolean includeDirectories,
java.lang.String fileFilter,
boolean escape)
List all the files and directories within the given directory.
|
public RecursiveFileFilter(boolean recursive, boolean includeFiles, boolean includeDirectories)
recursive
- Whether the filter should recursively list
subdirectories.includeFiles
- Whether files should be included.includeDirectories
- Whether directories should be included.public RecursiveFileFilter(boolean recursive, boolean includeFiles, boolean includeDirectories, boolean filesOnly, boolean directoriesOnly, java.lang.String fileFilter)
recursive
- Whether the filter should recursively list
subdirectories.includeFiles
- Whether files should be included.includeDirectories
- Whether directories should be included.filesOnly
- Whether only files should be includeddirectoriesOnly
- Whether only directories should be included.fileFilter
- The filter (with ? and * as wildcards) to filter
the accepted file names.public RecursiveFileFilter(boolean recursive, boolean includeFiles, boolean includeDirectories, boolean filesOnly, boolean directoriesOnly, java.lang.String fileFilter, boolean escape)
recursive
- Whether the filter should recursively list
subdirectories.includeFiles
- Whether files should be included.includeDirectories
- Whether directories should be included.filesOnly
- Whether only files should be includeddirectoriesOnly
- Whether only directories should be included.fileFilter
- The filter (with ? and * as wildcards) to filter
the accepted file names.escape
- True if a string with ? and * as wildcards is to
be converted into a Java regular expression. The DirectoryListing
actor calls this with a false value.public boolean accept(java.io.File dir, java.lang.String name)
accept
in interface java.io.FilenameFilter
dir
- The directory. If directory is null, then it is
likely that this method is being called to accept a URL and no
File object is instantiated. If directory is not null, then a
File object is instantiated.name
- The file or directory name within the given directory.public java.util.List<java.io.File> getFiles()
public static java.io.File[] listFiles(java.io.File directory, boolean recursive, boolean includeFiles, boolean includeDirectories, java.lang.String fileFilter)
directory
- The directory.recursive
- Whether the filter should recursively list
subdirectories.includeFiles
- Whether files should be included.includeDirectories
- Whether directories should be included.fileFilter
- The filter (with ? and * as wildcards) to filter
the accepted file names.public static java.io.File[] listFiles(java.io.File directory, boolean recursive, boolean includeFiles, boolean includeDirectories, java.lang.String fileFilter, boolean escape)
directory
- The directory.recursive
- Whether the filter should recursively list
subdirectories.includeFiles
- Whether files should be included.includeDirectories
- Whether directories should be included.fileFilter
- The filter (with ? and * as wildcards) to filter
the accepted file names.escape
- True if a string with ? and * as wildcards is to
be converted into a Java regular expression. The DirectoryListing
actor calls this with a false value.public static java.io.File[] listFiles(java.io.File directory, boolean recursive, boolean includeFiles, boolean includeDirectories, boolean filesOnly, boolean directoriesOnly, java.lang.String fileFilter)
directory
- The directory.recursive
- Whether the filter should recursively list
subdirectories.includeFiles
- Whether files should be included.includeDirectories
- Whether directories should be included.filesOnly
- Whether only files should be includeddirectoriesOnly
- Whether only directories should be included.fileFilter
- The filter (with ? and * as wildcards) to filter
the accepted file names.public static java.io.File[] listFiles(java.io.File directory, boolean recursive, boolean includeFiles, boolean includeDirectories, boolean filesOnly, boolean directoriesOnly, java.lang.String fileFilter, boolean escape)
directory
- The directory.recursive
- Whether the filter should recursively list
subdirectories.includeFiles
- Whether files should be included.includeDirectories
- Whether directories should be included.filesOnly
- Whether only files should be includeddirectoriesOnly
- Whether only directories should be included.fileFilter
- The filter (with ? and * as wildcards) to filter
the accepted file names.escape
- True if a string with ? and * as wildcards is to
be converted into a Java regular expression. The DirectoryListing
actor calls this with a false value.