public class DirectoryCollection extends CollectionAbstract
| Modifier and Type | Class and Description |
|---|---|
static interface |
DirectoryCollection.Visitor |
CollectionAbstract.DateSorter, CollectionAbstract.MyStreamFilterauxInfo, CATALOG, collectionName, dateExtractor, DIR, FILE, GLOB, lastModified, LIST, logger, NCX_SUFFIX, protoChoice, root, sfilter, startCollection| Constructor and Description |
|---|
DirectoryCollection(java.lang.String topCollectionName,
java.nio.file.Path collectionDir,
boolean isTop,
java.lang.String olderThan,
org.slf4j.Logger logger) |
DirectoryCollection(java.lang.String topCollectionName,
java.lang.String topDirS,
boolean isTop,
java.lang.String olderThan,
org.slf4j.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close and release any resources.
|
CloseableIterator<MFile> |
getFileIterator()
Get the current collection of MFile, no guaranteed order.
|
java.lang.Iterable<MFile> |
getFilesSorted()
Get the current collection of MFile.
|
java.lang.String |
getIndexFilename() |
java.lang.String |
getRoot()
Get common root directory of all MFiles in the collection - may be null
|
void |
iterateOverMFileCollection(DirectoryCollection.Visitor visit) |
static java.nio.file.Path |
makeCollectionIndexPath(java.lang.String topCollectionName,
java.nio.file.Path dir)
Create standard name = topCollectionName + last directory
|
static java.lang.String |
makeCollectionName(java.lang.String topCollectionName,
java.nio.file.Path dir)
Create standard name = topCollectionName + last directory
|
cleanName, extractDate, getAuxInfo, getCollectionName, getFilenames, getLastModified, getLatestFile, getPartitionDate, getProtoIndex, hasDateExtractor, makeFileListSorted, open, parseOlderThanString, putAuxInfo, setDateExtractor, setRoot, setStreamFilterpublic DirectoryCollection(java.lang.String topCollectionName,
java.lang.String topDirS,
boolean isTop,
java.lang.String olderThan,
org.slf4j.Logger logger)
public DirectoryCollection(java.lang.String topCollectionName,
java.nio.file.Path collectionDir,
boolean isTop,
java.lang.String olderThan,
org.slf4j.Logger logger)
public static java.lang.String makeCollectionName(java.lang.String topCollectionName,
java.nio.file.Path dir)
topCollectionName - from config, name of the collectiondir - directory for thispublic static java.nio.file.Path makeCollectionIndexPath(java.lang.String topCollectionName,
java.nio.file.Path dir)
topCollectionName - from config, name of the collectiondir - directory for thispublic java.lang.String getRoot()
MCollectiongetRoot in interface MCollectiongetRoot in class CollectionAbstractpublic java.lang.String getIndexFilename()
getIndexFilename in interface MCollectiongetIndexFilename in class CollectionAbstractpublic java.lang.Iterable<MFile> getFilesSorted() throws java.io.IOException
MCollectionjava.io.IOExceptionpublic CloseableIterator<MFile> getFileIterator() throws java.io.IOException
MCollection
try (CloseableIterator iter = getFileIterator()) {
while (iter.hasNext()) {
MFile file = iter.next();
}
}
java.io.IOExceptionpublic void close()
MCollectionpublic void iterateOverMFileCollection(DirectoryCollection.Visitor visit) throws java.io.IOException
java.io.IOException