Class FileNameAwareListener

java.lang.Object
org.zeroturnaround.javarebel.support.FileNameAwareListener
All Implemented Interfaces:
FileEventListener

public class FileNameAwareListener extends Object implements FileEventListener
Wrapper for filtering out events for only the specified file.
  • Constructor Details

    • FileNameAwareListener

      public FileNameAwareListener(FileEventListener listener, String fileName)
      Parameters:
      listener - event listener
      fileName - name of monitored file or null. If null all events in monitored directory will be forwarded to target listener.
  • Method Details

    • getParent

      public FileEventListener getParent()
    • isRecursive

      public boolean isRecursive()
      Specified by:
      isRecursive in interface FileEventListener
      Returns:
      true it the paths monitored by this listener should be monitored recursively.
    • onFileAdd

      public void onFileAdd(File file)
      Description copied from interface: FileEventListener
      Called when a new file was added.
      Specified by:
      onFileAdd in interface FileEventListener
      Parameters:
      file - resource path.
    • onFileRemove

      public void onFileRemove(File file)
      Description copied from interface: FileEventListener
      Called when an existing file was removed.
      Specified by:
      onFileRemove in interface FileEventListener
      Parameters:
      file - resource path.
    • onFileChange

      public void onFileChange(File file)
      Description copied from interface: FileEventListener
      Called when an existing file was modified.
      Specified by:
      onFileChange in interface FileEventListener
      Parameters:
      file - resource path.
    • onFileDirty

      public void onFileDirty(File file)
      Description copied from interface: FileEventListener
      Called when an event was lost or the state might be dirty.
      Specified by:
      onFileDirty in interface FileEventListener
      Parameters:
      file - resource path from event or mostly null.
    • onFailure

      public void onFailure()
      Description copied from interface: FileEventListener
      Called when monitoring has failed, after this listener may stop receiving events.
      Specified by:
      onFailure in interface FileEventListener