Package net.sf.eBusx.io
This package provides the ability to monitor file/directory
creation, modification, and deletion via the
file notification
.
The file name being watched is the message subject. For this
reason, the EFileWatcher
advertises
its service locally since it cannot watch files on other
hosts. Conversely, it can watch files mounted from remote file
systems.
The
file notification
contains:
- the file name (as the message subject),
-
the
event type
, - the file last modified time (as Java millisecond epoch),
- and the file length in bytes.
Watching a file or directory for changes is done by:
-
Starting the watcher service
. This service may be started at various rates fromEFileWatcher.MIN_WATCH_RATE
toEFileWatcher.MAX_WATCH_RATE
(inclusive) but this rate applies to all monitored files. -
Subscribing to a
EMessageKey
withEFileNotification
as the message class and the file/directory name as the subject.
-
Class Summary Class Description EFileNotification Used to transmit a JavaWatchEvent
asynchronously to all interested listeners.EFileNotification.Builder EFileWatcher This class provides an eBus file watcher service, allowing asynchronous notification when a file or directory is created, modified or deleted. -
Enum Summary Enum Description EFileNotification.EventType The watched file was either created, modified, or deleted.