Class OcflObjectRootDirIterator
- java.lang.Object
-
- edu.wisc.library.ocfl.core.storage.OcflObjectRootDirIterator
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterator<String>
- Direct Known Subclasses:
CloudOcflObjectRootDirIterator,FileSystemOcflObjectRootDirIterator
public abstract class OcflObjectRootDirIterator extends Object implements Iterator<String>, Closeable
Iterator that iterates over OCFL object root directories. Object roots are identified by the presence of a file that's prefixed with '0=ocfl_object'.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceOcflObjectRootDirIterator.DirectoryEncapsulates a directory for iterating over its children
-
Constructor Summary
Constructors Constructor Description OcflObjectRootDirIterator(String start)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected abstract OcflObjectRootDirIterator.DirectorycreateDirectory(String path)Creates an object to maintain directory statebooleanhasNext()protected abstract booleanisObjectRoot(String path)Indicates if a directory path is an object root pathStringnext()protected abstract booleanshouldSkip(String path)Returns true if the path should be skipped-
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, remove
-
-
-
-
Constructor Detail
-
OcflObjectRootDirIterator
public OcflObjectRootDirIterator(String start)
-
-
Method Detail
-
isObjectRoot
protected abstract boolean isObjectRoot(String path)
Indicates if a directory path is an object root path- Parameters:
path- directory path- Returns:
- true if path is an object root path
-
shouldSkip
protected abstract boolean shouldSkip(String path)
Returns true if the path should be skipped- Parameters:
path- directory path- Returns:
- true if path should be skipped
-
createDirectory
protected abstract OcflObjectRootDirIterator.Directory createDirectory(String path)
Creates an object to maintain directory state- Parameters:
path- directory path- Returns:
- directory object
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-