Package org.irods.irods4j.high_level.vfs
Class IRODSRecursiveCollectionIterator
java.lang.Object
org.irods.irods4j.high_level.vfs.IRODSRecursiveCollectionIterator
- All Implemented Interfaces:
Iterable<CollectionEntry>
A class which makes it easy to iterate over the contents of a collection,
including subcollections.
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe class providing the iterator implementation over a collection. -
Constructor Summary
ConstructorsConstructorDescriptionIRODSRecursiveCollectionIterator(IRODSApi.RcComm comm, String logicalPath) Initializes a newly created recursive iterator such that all entries within the collection and its subcollections will be visited.IRODSRecursiveCollectionIterator(IRODSApi.RcComm comm, String logicalPath, int rowsPerPage) Initializes a newly created recursive iterator.IRODSRecursiveCollectionIterator(IRODSApi.RcComm comm, String logicalPath, int rowsPerPage, IRODSCollectionIterator.CollectionOptions options) Initializes a newly created recursive iterator.IRODSRecursiveCollectionIterator(IRODSApi.RcComm comm, String logicalPath, IRODSCollectionIterator.CollectionOptions options) Initializes a newly created recursive iterator. -
Method Summary
Modifier and TypeMethodDescriptionvoidTemporarily disables recursion for the current iterator.Returns the collection options used to construct the iterator.intgetDepth()Returns the recursion depth from the starting collection.iterator()voidpop()Moves the current position of the iterator up a collection.booleanChecks whether recursion is enabled.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
IRODSRecursiveCollectionIterator
public IRODSRecursiveCollectionIterator(IRODSApi.RcComm comm, String logicalPath) throws IRODSFilesystemException, IOException, IRODSException Initializes a newly created recursive iterator such that all entries within the collection and its subcollections will be visited.- Parameters:
comm- The connection to the iRODS server.logicalPath- The absolute path to a collection.- Throws:
IRODSExceptionIOExceptionIRODSFilesystemException- Since:
- 0.1.0
-
IRODSRecursiveCollectionIterator
public IRODSRecursiveCollectionIterator(IRODSApi.RcComm comm, String logicalPath, int rowsPerPage) throws IRODSFilesystemException, IOException, IRODSException Initializes a newly created recursive iterator.- Parameters:
comm- The connection to the iRODS server.logicalPath- The absolute path to a collection.rowsPerPage- The max number of rows to fetch when a new page of data is needed.- Throws:
IRODSExceptionIOExceptionIRODSFilesystemException- Since:
- 0.1.0
-
IRODSRecursiveCollectionIterator
public IRODSRecursiveCollectionIterator(IRODSApi.RcComm comm, String logicalPath, IRODSCollectionIterator.CollectionOptions options) throws IRODSFilesystemException, IOException, IRODSException Initializes a newly created recursive iterator.- Parameters:
comm- The connection to the iRODS server.logicalPath- The absolute path to a collection.options- Options affecting the behavior of the iterator. Currently unused.- Throws:
IRODSExceptionIOExceptionIRODSFilesystemException- Since:
- 0.1.0
-
IRODSRecursiveCollectionIterator
public IRODSRecursiveCollectionIterator(IRODSApi.RcComm comm, String logicalPath, int rowsPerPage, IRODSCollectionIterator.CollectionOptions options) throws IRODSFilesystemException, IOException, IRODSException Initializes a newly created recursive iterator.- Parameters:
comm- The connection to the iRODS server.logicalPath- The absolute path to a collection.rowsPerPage- The max number of rows to fetch when a new page of data is needed.options- Options affecting the behavior of the iterator. Currently unused.- Throws:
IRODSExceptionIOExceptionIRODSFilesystemException- Since:
- 0.1.0
-
-
Method Details
-
getCollectionOptions
Returns the collection options used to construct the iterator.- Since:
- 0.1.0
-
getDepth
public int getDepth()Returns the recursion depth from the starting collection. The depth is 0-indexed.- Since:
- 0.1.0
-
recursionPending
public boolean recursionPending()Checks whether recursion is enabled.- Since:
- 0.1.0
-
pop
public void pop()Moves the current position of the iterator up a collection.- Since:
- 0.1.0
-
disableRecursionPending
public void disableRecursionPending()Temporarily disables recursion for the current iterator. Recursion is re-enabled after the iterator moves forward.- Since:
- 0.1.0
-
iterator
- Specified by:
iteratorin interfaceIterable<CollectionEntry>
-