It looks like you're talking about WatchService .
The ENTRY_CREATE statement says that a new record will be accepted if a new file is created or the file is renamed to a directory. It lacks a specification of which events are fired if the file is renamed and remains in the same directory.
The wording also indicates whether the execution of the service depends on the operating system or the polling. I suspect that the JRE implementation, therefore, even if you know that a particular OS supports it, this is not a guarantee that the service will use functionality at the OS level or resort to a survey. In fact, the service does not provide any way to determine if it is using a polling or OS level function.
The operations defined by the API also do not behave like a Listener. WatchService does an automatic review, but to get a list of events that occur, you still have to manually request the events you see from the service. It does not seem to provide any hooks to automatically call when a new event is present.
Atreys
source share