WatchService - Exposing more of the Inotify Event Model

John Hendrikx hjohn at xs4all.nl
Thu Sep 23 23:58:13 PDT 2010


Alan Bateman wrote:
> 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.
Well, I brought it up before... I too had to use a map to keep track of 
the original path :-)
>
> -Alan.
>



More information about the nio-dev mailing list