Reading the javadocs for WatchEvent
, I see that the count()
method lets me know if an event is repeated by its result.
Returns the event count. If the event count is greater than 1 then this is a repeated event.
What does that mean, exactly? Does it mean that two or more WatchEvent
objects refer to the same "event" (e.g. a file being created)?
I am experimenting with the example on Oracle's site for the new WatchService
API and this part confused me, especially because I will get a different number of events for successive runs of the same test code (in which I write to a file using a FileWriter
without interacting with it manually), but the result of count()
is never more than 1.
Edit: I realize that this may be related to this other question about repeated events, but that doesn't answer what it actually means for an event to be repeated.