Class AbstractFileChangeMonitor

    • Field Detail

      • m_Initialized

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

        protected File m_File
        the file to monitor.
    • Constructor Detail

      • AbstractFileChangeMonitor

        public AbstractFileChangeMonitor()
    • Method Detail

      • getQuickInfo

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

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

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

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

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

        public File getMonitoredFile()
        Returns the file that is being monitored.
        Specified by:
        getMonitoredFile in interface FileChangeMonitor
        Returns:
        the file, null if not initialized
      • checkChange

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

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

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