Package org.eclipse.sisu.space
Class FileEntryIterator
java.lang.Object
org.eclipse.sisu.space.FileEntryIterator
Iterator that iterates over named entries beneath a file-system directory.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFileEntryIterator(URL url, String subPath, boolean recurse) Creates an iterator that iterates over entries beneath the given file URL and sub-path. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidappendEntries(String subPath) Appends entries from the given sub-path to the cached list of named entries.booleanhasNext()next()private static StringnormalizePath(File file) Returns the normalized URI path of the given file.voidremove()(package private) static FileMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
rootPath
-
entryNames
-
recurse
private final boolean recurse
-
-
Constructor Details
-
FileEntryIterator
Creates an iterator that iterates over entries beneath the given file URL and sub-path.- Parameters:
url- The root file URLsubPath- The path below the root URLrecurse- Whentrueinclude sub-directories; otherwise don't
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
toFile
- Parameters:
url- The file URL- Returns:
- File instance for the given URL
-
appendEntries
Appends entries from the given sub-path to the cached list of named entries.- Parameters:
subPath- The sub path
-
normalizePath
Returns the normalized URI path of the given file.- Parameters:
file- The file to normalize- Returns:
- Normalized URI path
-