Class FileEvent

java.lang.Object
org.nuxeo.runtime.services.event.Event
org.nuxeo.runtime.trackers.files.FileEvent
Direct Known Subclasses:
DirectoryEvent

public class FileEvent extends Event
Runtime events about transient files which should be deleted once the runtime leave the thread ( FileEventTracker).

Producers should use the static onFile(Object, File, Object) factory method and fire events by invoking the event's send() method:

 FileEvent.onFile(source, aFile, aMarker).send();
 

Consumers should implements the FileEventHandler interface and register in the EventService using the FileEventListener wrapper:

 FileEventListener filesListener = new FileEventListener(new FileEventHandler() {
     @Override
     public void onFile(File file, Object marker) {
         ...
     }
 });
 ...
 filesListener.install();
 ...
 filesListener.uninstall();
 
Since:
6.0
Author:
Stephane Lacoin at Nuxeo (aka matic)