private class JavaReduxFileCollection.Walker extends Object implements FileCollection.Walker
| Modifier and Type | Field and Description |
|---|---|
private String |
current
The currently open resource.
|
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.WalkerDataLocation object describing the current file.
The dynamic type of the result depends on the implementation in use.getCurrentDataLocation in interface FileCollection.WalkerDataLocation, not nullNoSuchElementException - if the previous call to step returned false.public String getCurrentName() throws NoSuchElementException
FileCollection.WalkergetCurrentName in interface FileCollection.WalkerNoSuchElementException - if the previous call to step returned false.public String getType()
FileCollection.WalkergetType in interface FileCollection.Walkerpublic InputStream openCurrent() throws IOException, NoSuchElementException
FileCollection.WalkeropenCurrent in interface FileCollection.WalkerIOException - if the resource cannot be openedNoSuchElementException - if the previous call to step returned false.public boolean step()
FileCollection.Walkerstep in interface FileCollection.Walker