Class WeakRefFileListener

    • Method Detail

      • installListener

        public static void installListener​(FileObject file,
                                           FileListener listener)
        This will install the listener at the given file.
        Parameters:
        file - The FileObject to listen on.
        listener - The FileListener
      • getListener

        protected FileListener getListener()
                                    throws java.lang.Exception
        returns the wrapped listener. If it is gone, the WeakRefFileListener wrapper will remove itself from the list of listeners.
        Returns:
        The FileListener.
        Throws:
        java.lang.Exception - if an error occurs.
      • fileCreated

        public void fileCreated​(FileChangeEvent event)
                         throws java.lang.Exception
        Called when a file is created.
        Specified by:
        fileCreated in interface FileListener
        Parameters:
        event - The FileChangeEvent.
        Throws:
        java.lang.Exception - if an error occurs.
      • fileDeleted

        public void fileDeleted​(FileChangeEvent event)
                         throws java.lang.Exception
        Called when a file is deleted.
        Specified by:
        fileDeleted in interface FileListener
        Parameters:
        event - The FileChangeEvent.
        Throws:
        java.lang.Exception - if an error occurs.
      • fileChanged

        public void fileChanged​(FileChangeEvent event)
                         throws java.lang.Exception
        Called when a file is changed.

        This will only happen if you monitor the file using FileMonitor.

        Specified by:
        fileChanged in interface FileListener
        Parameters:
        event - The FileChangeEvent.
        Throws:
        java.lang.Exception - if an error occurs.