Extend WatchService class and override callbacks (onEntryCreated(), ...) to trigger related event.
There are two groups of callbacks:
-
Jgroup:onEntryCreatedJ(),onEntryModifiedJ(),onEntryDeletedJ(),onOverflowedJ():These are default (un-manipulated) callbacks. They are invoked regularly when a related event occurs. You should override them when you wish trigger native
java.nio.file.WatchServiceevents.For example override: