WatchService - Exposing more of the Inotify Event Model

Alan Bateman Alan.Bateman at oracle.com
Thu Sep 23 17:15:44 PDT 2010


Benedict Elliott Smith wrote:
> While on the topic of the WatchService API, I wonder if there are any 
> plans to modify the WatchKey to include a method for retrieving the 
> object/path it is watching. 
I've often wondered when this would come up :-)  It was left out because 
of concern that the watch may be on the file (think inode). It may also 
be confusing where you attempt to watch a directory that is already 
being watched, but originally registered with a completely different 
path. It's clearly something that needs to be looked at again, now that 
the API has been used for some time. If WatchKey does get a method to 
return the Watchable then it could only reasonably be specified to 
returned the original Watchable.

-Alan.


More information about the nio-dev mailing list