private class JavaReduxFileCollection.Walker extends Object implements FileCollection.Walker
Modifier and Type | Field and Description |
---|---|
private String |
current
The currently open resource. null before the first step and after the last step.
|
private URL |
currentURL
The URL of the current resource.
|
private Iterator<String> |
iterator
The iterator to wrap, it iterates the resources to open.
|
Modifier | Constructor and Description |
---|---|
private |
Walker(Iterator<String> iterator) |
Modifier and Type | Method and Description |
---|---|
DataLocation |
getCurrentDataLocation()
get a
DataLocation object describing the current file. |
String |
getCurrentName()
get the name of the current file in the iteration.
|
String |
getType()
return the type of the structure that is iterated.
|
InputStream |
openCurrent()
create a new InputStream for the current element of the iteration.
|
boolean |
step()
step to next element in the collection if there is another one.
|
private String current
private URL currentURL
public DataLocation getCurrentDataLocation() throws NoSuchElementException
FileCollection.Walker
DataLocation
object describing the current file.
The dynamic type of the result depends on the implementation in use.getCurrentDataLocation
in interface FileCollection.Walker
DataLocation
, not nullNoSuchElementException
- if the previous call to step returned false.public String getCurrentName() throws NoSuchElementException
FileCollection.Walker
getCurrentName
in interface FileCollection.Walker
NoSuchElementException
- if the previous call to step returned false.public String getType()
FileCollection.Walker
getType
in interface FileCollection.Walker
public InputStream openCurrent() throws IOException, NoSuchElementException
FileCollection.Walker
openCurrent
in interface FileCollection.Walker
IOException
- if the resource cannot be openedNoSuchElementException
- if the previous call to step returned false.public boolean step()
FileCollection.Walker
step
in interface FileCollection.Walker