Class ModifiableFileWatcher

    • Constructor Detail

      • ModifiableFileWatcher

        public ModifiableFileWatcher​(Path file)
      • ModifiableFileWatcher

        public ModifiableFileWatcher​(Path file,
                                     LinkOption... options)
    • Method Detail

      • getPath

        public final Path getPath()
        Returns:
        The watched Path
      • checkReloadRequired

        public boolean checkReloadRequired()
                                    throws IOException
        Returns:
        true if the watched file has probably been changed
        Throws:
        IOException - If failed to query file data
      • resetReloadAttributes

        public void resetReloadAttributes()
        Resets the state attributes used to detect changes to the initial construction values - i.e., file assumed not to exist and no known size of modify time
      • updateReloadAttributes

        public void updateReloadAttributes()
                                    throws IOException
        May be called to refresh the state attributes used to detect changes e.g., file existence, size and last-modified time once re-loading is successfully completed. If the file does not exist then the attributes are reset to an "unknown" state.
        Throws:
        IOException - If failed to access the file (if exists)
        See Also:
        resetReloadAttributes()