|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.io.findfile.FindFile
public class FindFile
Generic iterative file finder. Searches all files on specified search path.
WildcardFindFile,
RegExpFindFile,
todo: Add sorting and comparators| Field Summary | |
|---|---|
protected java.util.LinkedList<java.io.File> |
fileList
|
protected boolean |
includeDirs
|
protected boolean |
includeFiles
|
protected boolean |
listSubfilesAfterFolder
|
protected boolean |
recursive
|
| Constructor Summary | |
|---|---|
FindFile()
|
|
| Method Summary | |
|---|---|
protected boolean |
acceptFile(java.io.File currentFile)
Called on each file entry (file or directory) and returns true
if file passes search criteria. |
protected void |
addSearchPath(java.io.File searchPath)
Adds existing search path to the file list. |
boolean |
isIncludeDirs()
|
boolean |
isIncludeFiles()
|
boolean |
isListSubfilesAfterFolder()
|
boolean |
isRecursive()
|
java.util.Iterator<java.io.File> |
iterator()
Returns file walker iterator. |
protected void |
listFiles(java.io.File directory)
List all files and folders in specified directory. |
java.io.File |
nextFile()
Finds the next file. |
FindFile |
searchPath(java.io.File... searchPath)
Specifies a set of search paths. |
FindFile |
searchPath(java.io.File searchPath)
Specifies single search path. |
FindFile |
searchPath(java.lang.String... searchPaths)
Specifies search paths. |
FindFile |
searchPath(java.lang.String searchPath)
Specifies the search path. |
FindFile |
searchPath(java.net.URI... searchPath)
Specifies the search path. |
FindFile |
searchPath(java.net.URI searchPath)
Specifies the search path. |
FindFile |
searchPath(java.net.URL... searchPath)
Specifies the search path. |
FindFile |
searchPath(java.net.URL searchPath)
Specifies the search path. |
FindFile |
setIncludeDirs(boolean includeDirs)
Include directories in search. |
FindFile |
setIncludeFiles(boolean includeFiles)
Include files in search. |
FindFile |
setListSubfilesAfterFolder(boolean listSubfilesAfterFolder)
If set to true then all subfiles of a folder will be listed
directly after the folder, while folder will be listed first. |
FindFile |
setRecursive(boolean recursive)
Activates recursive search. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean recursive
protected boolean includeDirs
protected boolean includeFiles
protected java.util.LinkedList<java.io.File> fileList
protected boolean listSubfilesAfterFolder
| Constructor Detail |
|---|
public FindFile()
| Method Detail |
|---|
public boolean isRecursive()
public FindFile setRecursive(boolean recursive)
public boolean isIncludeDirs()
public FindFile setIncludeDirs(boolean includeDirs)
public boolean isIncludeFiles()
public FindFile setIncludeFiles(boolean includeFiles)
protected void addSearchPath(java.io.File searchPath)
public FindFile searchPath(java.io.File searchPath)
public FindFile searchPath(java.io.File... searchPath)
public FindFile searchPath(java.lang.String searchPath)
File.pathSeparator than string will be tokenized
and each part will be added separately as a search path.
public FindFile searchPath(java.lang.String... searchPaths)
searchPath(String)public FindFile searchPath(java.net.URI searchPath)
public FindFile searchPath(java.net.URI... searchPath)
public FindFile searchPath(java.net.URL searchPath)
public FindFile searchPath(java.net.URL... searchPath)
public boolean isListSubfilesAfterFolder()
public FindFile setListSubfilesAfterFolder(boolean listSubfilesAfterFolder)
true then all subfiles of a folder will be listed
directly after the folder, while folder will be listed first. Otherwise,
sub files will be listed after the all files of current folder.
public java.io.File nextFile()
null if no more files can be found.
public java.util.Iterator<java.io.File> iterator()
protected void listFiles(java.io.File directory)
protected boolean acceptFile(java.io.File currentFile)
true
if file passes search criteria.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||