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 void
appendEntries
(String subPath) Appends entries from the given sub-path to the cached list of named entries.boolean
hasNext()
next()
private static String
normalizePath
(File file) Returns the normalized URI path of the given file.void
remove()
(package private) static File
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
- Whentrue
include 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
-