Package org.nuxeo.runtime.trackers.files
Class FileEvent
java.lang.Object
org.nuxeo.runtime.services.event.Event
org.nuxeo.runtime.trackers.files.FileEvent
- Direct Known Subclasses:
DirectoryEvent
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)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected File
getFile()
protected Object
void
handle
(FileEventHandler handler) static void
ignore
(FileEventListener aListener) static void
listen
(FileEventListener aListener) static DirectoryEvent
onDirectory
(Object source, File aFile, Object aMarker) static FileEvent
void
send()
-
Constructor Details
-
FileEvent
-
-
Method Details
-
listen
-
ignore
-
send
public void send() -
handle
-
getFile
-
getMarker
-
onFile
-
onDirectory
- Since:
- 2023.5
-