com.myJava.file.iterator
Class FileSystemIterator
java.lang.Object
com.myJava.file.iterator.FileSystemIterator
- All Implemented Interfaces:
- java.util.Iterator
public class FileSystemIterator
- extends java.lang.Object
- implements java.util.Iterator
This iterator lists all elements of a source directory. They can be either files or subdirectories.
Subdirectories are processed recursively.
The iterator can iterate following the path's components lexicographic order if the "sorted" attribute is set to "true".
It also ensures that all parents of a file returned by the "next" method have been previously returned.
- Author:
- Olivier PETRUCCI
Areca Build ID : 7299034069467778562
Constructor Summary |
FileSystemIterator(java.io.File baseDirectory,
boolean followSymLinks,
boolean followSubdirectories,
boolean returnEmptyDirectories,
boolean sorted)
|
FileSystemIterator(java.io.File root,
java.lang.String[] sources,
boolean followSymLinks,
boolean followSubdirectories,
boolean returnEmptyDirectories,
boolean sorted)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
filter
protected FileSystemIteratorFilter filter
root
protected java.io.File root
baseDirectory
protected java.io.File baseDirectory
followSymLinks
protected boolean followSymLinks
followSubdirectories
protected boolean followSubdirectories
forceAllDirectories
protected boolean forceAllDirectories
sorted
protected boolean sorted
monitor
protected TaskMonitor monitor
logProgress
protected boolean logProgress
warnDanglingLinks
protected boolean warnDanglingLinks
currentLevel
protected FileSystemLevel currentLevel
fileSystemLevels
protected java.util.Stack fileSystemLevels
priorFiles
protected java.util.Stack priorFiles
nextCachedFile
protected java.io.File nextCachedFile
sourceIterator
protected java.util.Iterator sourceIterator
currentFileSystemSubIterator
protected FileSystemIterator currentFileSystemSubIterator
filtered
protected long filtered
files
protected long files
directories
protected long directories
sourceCount
protected long sourceCount
initialized
protected boolean initialized
pushedRoots
protected java.util.Set pushedRoots
FileSystemIterator
public FileSystemIterator(java.io.File baseDirectory,
boolean followSymLinks,
boolean followSubdirectories,
boolean returnEmptyDirectories,
boolean sorted)
FileSystemIterator
public FileSystemIterator(java.io.File root,
java.lang.String[] sources,
boolean followSymLinks,
boolean followSubdirectories,
boolean returnEmptyDirectories,
boolean sorted)
setWarnDanglingLinks
public void setWarnDanglingLinks(boolean warnDanglingLinks)
setMonitor
public void setMonitor(TaskMonitor monitor)
setFilter
public void setFilter(FileSystemIteratorFilter filter)
isLogProgress
public boolean isLogProgress()
setLogProgress
public void setLogProgress(boolean logProgress)
getFiltered
public long getFiltered()
- Return the total number of files that have been filtered
getFiles
public long getFiles()
getDirectories
public long getDirectories()
next
public java.lang.Object next()
- Same as nextFile()
- Specified by:
next
in interface java.util.Iterator
nextFile
public java.io.File nextFile()
- Returns the next file
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface java.util.Iterator
remove
public void remove()
- Specified by:
remove
in interface java.util.Iterator