Class AbstractDirChangeMonitor

    • Field Detail

      • m_RegExp

        protected BaseRegExp m_RegExp
        the regexp for the files to list.
      • m_Initialized

        protected boolean m_Initialized
        whether the monitor has been initialized.
      • m_Dir

        protected File m_Dir
        the dir to monitor.
      • m_LastFiles

        protected Set<File> m_LastFiles
        the list of files from the last check.
    • Constructor Detail

      • AbstractDirChangeMonitor

        public AbstractDirChangeMonitor()
    • Method Detail

      • setRegExp

        public void setRegExp​(BaseRegExp value)
        Sets the regular expression for selecting the subset of files to monitor in the directory.
        Parameters:
        value - the regexp
      • getRegExp

        public BaseRegExp getRegExp()
        Returns the regular expression for selecting a subset of files to monitor.
        Returns:
        the regexp
      • regExpTipText

        public String regExpTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the object, which can be displayed in the GUI.
        Specified by:
        getQuickInfo in interface QuickInfoSupporter
        Returns:
        null if no info available, otherwise short string
      • isInitialized

        public boolean isInitialized​(File dir)
        Checks whether the monitor has been initialized with the specified dir.
        Specified by:
        isInitialized in interface DirChangeMonitor
        Parameters:
        dir - the dir to check
        Returns:
        true if setup for this dir
        See Also:
        initialize(File)
      • checkFile

        protected String checkFile​(File dir)
        Performs some basic checks on the dir.
        Parameters:
        dir - the dir to check
        Returns:
        null if successful, otherwise error message
      • doInitialize

        protected abstract String doInitialize​(File dir)
        Performs the actual initialization of the monitor with the specified dir.
        Parameters:
        dir - the dir to initialize with
        Returns:
        null if successful, otherwise error message
      • initialize

        public String initialize​(File dir)
        Initializes the monitor with the specified file.
        Specified by:
        initialize in interface DirChangeMonitor
        Parameters:
        dir - the dir to initialize with
        Returns:
        null if successful, otherwise error message
      • getMonitoredDir

        public File getMonitoredDir()
        Returns the dir that is being monitored.
        Specified by:
        getMonitoredDir in interface DirChangeMonitor
        Returns:
        the dir, null if not initialized
      • listFiles

        protected List<File> listFiles​(File dir)
        Returns a list of files in the specified directory.
        Parameters:
        dir - the directory to get the files for
        Returns:
        the list of files
      • checkContentChanged

        protected boolean checkContentChanged​(File dir)
        Fast check whether the number of files or names have changed.
        Parameters:
        dir - the dir to check
        Returns:
        true if changed
      • checkChange

        protected abstract boolean checkChange​(File dir)
        Performs the actual check whether the dir has changed.
        Parameters:
        dir - the dir to check
        Returns:
        true if changed
      • doUpdate

        protected abstract String doUpdate​(File dir)
        Performs the actual updating of the monitor with the specified dir.
        Parameters:
        dir - the dir to update with
        Returns:
        null if successful, otherwise error message
      • update

        public String update​(File dir)
        Updates the monitor with the specified dir.
        Specified by:
        update in interface DirChangeMonitor
        Parameters:
        dir - the dir to update with
        Returns:
        null if successful, otherwise error message