Package thredds.inventory
Class CollectionPathMatcher
- java.lang.Object
-
- thredds.inventory.CollectionAbstract
-
- thredds.inventory.CollectionPathMatcher
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,MCollection
- Direct Known Subclasses:
TimePartition
public class CollectionPathMatcher extends CollectionAbstract
A collection defined by the collection spec (not directory sensitive) May have by regexp: or glob: (experimental)- Since:
- 12/23/2014
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class thredds.inventory.CollectionAbstract
CollectionAbstract.DateSorter, CollectionAbstract.MyStreamFilter
-
-
Field Summary
Fields Modifier and Type Field Description protected FeatureCollectionConfig
config
-
Fields inherited from class thredds.inventory.CollectionAbstract
auxInfo, CATALOG, collectionName, dateExtractor, DIR, FILE, GLOB, lastModified, LIST, logger, protoChoice, root, sfilter, startCollection
-
-
Constructor Summary
Constructors Constructor Description CollectionPathMatcher(FeatureCollectionConfig config, CollectionSpecParserAbstract specp, org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close and release any resources.CloseableIterator<MFile>
getFileIterator()
Get the current collection of MFile, no guaranteed order.Iterable<MFile>
getFilesSorted()
Get the current collection of MFile.-
Methods inherited from class thredds.inventory.CollectionAbstract
cleanName, extractDate, getAuxInfo, getCollectionName, getFilenames, getIndexFilename, getLastModified, getLatestFile, getPartitionDate, getProtoIndex, getRoot, hasDateExtractor, makeFileListSorted, open, parseOlderThanString, putAuxInfo, setDateExtractor, setRoot, setStreamFilter
-
-
-
-
Field Detail
-
config
protected final FeatureCollectionConfig config
-
-
Constructor Detail
-
CollectionPathMatcher
public CollectionPathMatcher(FeatureCollectionConfig config, CollectionSpecParserAbstract specp, org.slf4j.Logger logger)
-
-
Method Detail
-
close
public void close()
Description copied from interface:MCollection
Close and release any resources. Do not make further calls on this object.
-
getFilesSorted
public Iterable<MFile> getFilesSorted() throws IOException
Description copied from interface:MCollection
Get the current collection of MFile. if hasDateExtractor() == true, these will be sorted by Date, otherwise by path.- Returns:
- current collection of MFile as an Iterable.
- Throws:
IOException
-
getFileIterator
public CloseableIterator<MFile> getFileIterator() throws IOException
Description copied from interface:MCollection
Get the current collection of MFile, no guaranteed order. May be faster than getFilesSorted() for large collections, use when order is not important.try (CloseableIterator
iter = getFileIterator()) { while (iter.hasNext()) { MFile file = iter.next(); } } - Returns:
- current collection of MFile as an CloseableIterator.
- Throws:
IOException
-
-