public class Nio2ModificationWatcher extends ModificationWatcher
ModificationWatcher.Entry
Constructor and Description |
---|
Nio2ModificationWatcher(Application application,
Duration pollFrequency)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkCreated(org.slf4j.Logger log)
Checks for newly created files and folders.
|
void |
destroy()
Stops this
ModificationWatcher . |
protected void |
entryCreated(Path path,
org.slf4j.Logger log)
A callback method called when a new Path entry is created
|
protected void |
entryDeleted(Path path,
org.slf4j.Logger log)
A callback method called when a new Path entry is deleted
|
protected void |
entryModified(Path path,
org.slf4j.Logger log)
A callback method called when a new Path entry is modified
|
protected WatchEvent.Kind[] |
getWatchedKinds(Path folder) |
void |
start(Duration pollFrequency)
Starts watching at a given
Duration polling rate. |
add, checkModified, getEntries, remove
public Nio2ModificationWatcher(Application application, Duration pollFrequency)
application
- The application that manages the cachespollFrequency
- How often to check on IModifiable
spublic void start(Duration pollFrequency)
IModificationWatcher
Duration
polling rate.start
in interface IModificationWatcher
start
in class ModificationWatcher
pollFrequency
- the polling rate Duration
protected void checkCreated(org.slf4j.Logger log)
Markup.NO_MARKUP
(Not Found) entries for them already.log
- a logger that can be used to log the eventsprotected void entryModified(Path path, org.slf4j.Logger log)
path
- the modified pathlog
- a logger that can be used to log the eventsprotected void entryDeleted(Path path, org.slf4j.Logger log)
path
- the deleted pathlog
- a logger that can be used to log the eventsprotected void entryCreated(Path path, org.slf4j.Logger log)
path
- the new path entrylog
- a logger that can be used to log the eventspublic void destroy()
IModificationWatcher
ModificationWatcher
.destroy
in interface IModificationWatcher
destroy
in class ModificationWatcher
protected WatchEvent.Kind[] getWatchedKinds(Path folder)
folder
- the folder that will be watchedCopyright © 2006–2022 Apache Software Foundation. All rights reserved.