Class MFileCollectionManager

    • Constructor Detail

      • MFileCollectionManager

        protected MFileCollectionManager​(String name,
                                         org.slf4j.Logger logger)
      • MFileCollectionManager

        public MFileCollectionManager​(String name,
                                      String spec,
                                      Formatter errlog,
                                      org.slf4j.Logger logger)
    • Method Detail

      • setController

        public void setController​(MController _controller)
        Set the MController used by scan. Defaults to thredds.filesystem.ControllerOS() if not set.
        Parameters:
        _controller - use this MController
      • addDirectoryScan

        public void addDirectoryScan​(String dirName,
                                     String suffix,
                                     String regexpPatternString,
                                     String subdirsS,
                                     String olderS,
                                     Object auxInfo)
        Add a directory scan to the collection
        Parameters:
        dirName - scan this directory
        suffix - require this suffix (overriddden by regexp), may be null
        regexpPatternString - if present, use this reqular expression to filter files , may be null
        subdirsS - if "true", descend into subdirectories, may be null
        olderS - udunit time unit - files must be older than this amount of time (now - lastModified > olderTime), may be null // * @param dateFormatString dateFormatMark string, may be null
        auxInfo - attach this object to any MFile found by this scan
      • getOlderThanFilterInMSecs

        public long getOlderThanFilterInMSecs()
      • getLastScanned

        public long getLastScanned()
        Description copied from interface: CollectionManager
        Get the last time scanned
        Returns:
        msecs since 1970
      • getLastChanged

        public long getLastChanged()
        Description copied from interface: CollectionManager
        Get the last time the collection changed
        Returns:
        msecs since 1970
      • hasScans

        protected boolean hasScans()
      • isScanNeeded

        public boolean isScanNeeded()
        Compute if synchronous scan is needed. True if recheck is true and enough time has elapsed.
        Returns:
        true if rescan is needed
      • scan

        public boolean scan​(boolean sendEvent)
                     throws IOException
        Description copied from interface: CollectionManager
        Scan the collection. Files may have been deleted or added since last time. If the MFile already exists in the current list, leave it in the list. If anything changes, send TriggerEvent(TriggerType.update) and return true Get the results from getFiles()
        Returns:
        true if anything actually changed.
        Throws:
        IOException - on I/O error
      • setFilesAndRunDate

        public void setFilesAndRunDate​(Map<String,​String> filesRunDateMap)
      • getFilesSorted

        public Iterable<MFile> getFilesSorted()
        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.