Class FileNameAwareListener
java.lang.Object
org.zeroturnaround.javarebel.support.FileNameAwareListener
- All Implemented Interfaces:
FileEventListener
Wrapper for filtering out events for only the specified file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidCalled when monitoring has failed, after this listener may stop receiving events.voidCalled when a new file was added.voidonFileChange(File file) Called when an existing file was modified.voidonFileDirty(File file) Called when an event was lost or the state might be dirty.voidonFileRemove(File file) Called when an existing file was removed.
-
Constructor Details
-
FileNameAwareListener
- Parameters:
listener- event listenerfileName- name of monitored file or null. If null all events in monitored directory will be forwarded to target listener.
-
-
Method Details
-
getParent
-
isRecursive
public boolean isRecursive()- Specified by:
isRecursivein interfaceFileEventListener- Returns:
- true it the paths monitored by this listener should be monitored recursively.
-
onFileAdd
Description copied from interface:FileEventListenerCalled when a new file was added.- Specified by:
onFileAddin interfaceFileEventListener- Parameters:
file- resource path.
-
onFileRemove
Description copied from interface:FileEventListenerCalled when an existing file was removed.- Specified by:
onFileRemovein interfaceFileEventListener- Parameters:
file- resource path.
-
onFileChange
Description copied from interface:FileEventListenerCalled when an existing file was modified.- Specified by:
onFileChangein interfaceFileEventListener- Parameters:
file- resource path.
-
onFileDirty
Description copied from interface:FileEventListenerCalled when an event was lost or the state might be dirty.- Specified by:
onFileDirtyin interfaceFileEventListener- Parameters:
file- resource path from event or mostly null.
-
onFailure
public void onFailure()Description copied from interface:FileEventListenerCalled when monitoring has failed, after this listener may stop receiving events.- Specified by:
onFailurein interfaceFileEventListener
-