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:

  1. Starting the watcher service. This service may be started at various rates from EFileWatcher.MIN_WATCH_RATE to EFileWatcher.MAX_WATCH_RATE (inclusive) but this rate applies to all monitored files.
  2. Subscribing to a EMessageKey with EFileNotification as the message class and the file/directory name as the subject.