Java 7 WatchService - Ignoring multiple occurrences of the same event
The javadoc for StandardWatchEventKinds.ENTRY_MODIFY says: Directory entry modified. When a directory is registered for this event then the WatchKey is queued when it is observed that an entry in the directory has been modified. The event count for this event is 1 or greater. When you edit the content of a file through an editor, it'll modify both date (or other metadata) and content. You therefore get two ENTRY_MODIFY events, but each will have a count of 1 (at least that's what I'm seeing). I'm trying to monitor a configuration file ( servers.cfg previously registered with the WatchService )