Class FileWatcher

    • Field Detail

      • DEFAULT_CHECK_INTERVAL_MS

        public static final long DEFAULT_CHECK_INTERVAL_MS
        See Also:
        Constant Field Values
    • Constructor Detail

      • FileWatcher

        public FileWatcher​(@NotNull
                           File file)
        Parameters:
        file - file to watch changes in. May denote a directory as well, its lastModified attribute will be monitored for the change
      • FileWatcher

        public FileWatcher​(@NotNull
                           File file,
                           @NotNull
                           ScheduledExecutorService scheduler)
        Parameters:
        scheduler - executor that will be used to schedule watcher tasks
        file - file to watch changes in. May denote a directory as well, its lastModified attribute will be monitored for the change
    • Method Detail

      • getRequestor

        public String getRequestor()
        Description copied from interface: ChangeProvider
        Returns (short) string representation of this change source
        Specified by:
        getRequestor in interface ChangeProvider
        Returns:
        (short) string representation of this change source
      • getFile

        @NotNull
        public File getFile()
        Returns:
        monitored file
      • describe

        @NotNull
        public String describe​(boolean verbose)
        Specified by:
        describe in interface Loggable
        Parameters:
        verbose - verbosity of object description
        Returns:
        description of this object. If verbose is true, description should have mode details.