|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ptolemy.domains.ptera.lib.ListDirectory.RecursiveFileFilter
public static class ListDirectory.RecursiveFileFilter
A file name filter that can recursively list files in a directory, including those in subdirectories. When a file name referring to a directory is found, this filter lists the files within that directory again with a new filter in this class.
Red (tfeng) |
Yellow (tfeng) |
Nested Class Summary | |
---|---|
private static class |
ListDirectory.RecursiveFileFilter.FileComparator
A comparator to sort file names. |
Field Summary | |
---|---|
private java.util.regex.Pattern |
_ESCAPER
The pattern for the wildcard conversion. |
private java.util.List<java.io.File> |
_files
The list the recently found files and directories. |
private boolean |
_includeDirectories
Whether directories should be included. |
private boolean |
_includeFiles
Whether files should be included. |
private java.util.regex.Pattern |
_pattern
The pattern for the filter. |
private boolean |
_recursive
Whether the filter should recursively list subdirectories. |
Constructor Summary | |
---|---|
ListDirectory.RecursiveFileFilter(boolean recursive,
boolean includeFiles,
boolean includeDirectories)
Construct a recursive file filter. |
|
ListDirectory.RecursiveFileFilter(boolean recursive,
boolean includeFiles,
boolean includeDirectories,
java.lang.String fileFilter)
Construct a recursive file filter. |
Method Summary | |
---|---|
private java.lang.String |
_escape(java.lang.String string)
Convert a string with ? |
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,
java.lang.String fileFilter)
List all the files and directories within the given directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.util.regex.Pattern _ESCAPER
private java.util.List<java.io.File> _files
private boolean _includeDirectories
private boolean _includeFiles
private java.util.regex.Pattern _pattern
private boolean _recursive
Constructor Detail |
---|
public ListDirectory.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 ListDirectory.RecursiveFileFilter(boolean recursive, boolean includeFiles, boolean includeDirectories, java.lang.String fileFilter)
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.Method Detail |
---|
public boolean accept(java.io.File dir, java.lang.String name)
accept
in interface java.io.FilenameFilter
dir
- The directory.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.
private java.lang.String _escape(java.lang.String string)
string
- The string with file name wildcards.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |