Directory watch service, creates an event when a file in a given directory is created, modified oder deleted.
| Modifiers | Name | Description |
|---|---|---|
static class |
DirWatchService.DirWatchJob |
Internal class, only public because otherwise not called by quartz scheduler. |
| Constructor and description |
|---|
DirWatchService
(Jexler jexler, java.lang.String id)Constructor. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.lang.String |
getCron()Get cron pattern. |
|
java.io.File |
getDir()Get directory to watch. |
|
Jexler |
getJexler()Get jexler. |
|
java.util.List<WatchEvent.Kind<java.nio.file.Path>> |
getKinds()Get kinds of events to watch for. |
|
java.util.List<WatchEvent.Modifier> |
getModifiers()Get modifiers when watching for events. |
|
org.quartz.Scheduler |
getScheduler()Get quartz scheduler. |
|
DirWatchService |
setCron(java.lang.String cron)Set cron pattern for when to check. |
|
DirWatchService |
setDir(java.io.File dir)Set directory to watch. |
|
DirWatchService |
setKinds(java.util.List<WatchEvent.Kind<java.nio.file.Path>> kinds)Set kinds of events to watch for. |
|
DirWatchService |
setModifiers(java.util.List<WatchEvent.Modifier> modifiers)Set modifiers when watching for events. |
|
DirWatchService |
setScheduler(org.quartz.Scheduler scheduler)Set quartz scheduler. |
|
void |
start() |
|
void |
stop() |
|
void |
zap() |
| Methods inherited from class | Name |
|---|---|
class ServiceBase |
getId, getState, setState |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor.
jexler - the jexler to send events toid - the id of the serviceGet cron pattern.
Get directory to watch.
Get jexler.
Get kinds of events to watch for.
Get modifiers when watching for events.
Get quartz scheduler.
Set cron pattern for when to check. Default is every 5 seconds.
Set directory to watch. Default if not set is the directory that contains the jexler.
dir - directory to watchSet kinds of events to watch for. Default is standard events for create, modify and delete.
Set modifiers when watching for events.
On Mac OS X, by default the file system seems to be polled
every 10 seconds; to reduce this to 2 seconds, pass a modifier
com.sun.nio.file.SensitivityWatchEventModifier.HIGH.
Set quartz scheduler. Default is a scheduler shared by all jexlers in the same jexler container.
Groovy Documentation