Class LapisCoreFileWatcher


  • public class LapisCoreFileWatcher
    extends java.lang.Object
    An utility class for reloading files when they are edited
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkOtherFile​(java.io.File f)
      Override this method to deal with an unhandled file being edited This will only be fired for unknown files, it will not trigger when config or messages files are edited
      void fileUpdate​(java.io.File f)
      Override this method to deal with a file being edited This will be fired for every file change, including config.yml and messages.yml files
      void stop()
      Used to safely stop the file watcher
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LapisCoreFileWatcher

        public LapisCoreFileWatcher​(LapisCorePlugin core)
        Start the file watcher
        Parameters:
        core - The LapisCorePlugin that the file watcher should be registered to
    • Method Detail

      • stop

        public void stop()
        Used to safely stop the file watcher
      • fileUpdate

        public void fileUpdate​(java.io.File f)
        Override this method to deal with a file being edited This will be fired for every file change, including config.yml and messages.yml files
        Parameters:
        f - The file that has been updated
      • checkOtherFile

        public void checkOtherFile​(java.io.File f)
        Override this method to deal with an unhandled file being edited This will only be fired for unknown files, it will not trigger when config or messages files are edited
        Parameters:
        f - The file that has been updated