WatchService - Exposing more of the Inotify Event Model

fm fudmail at gmail.com
Tue Oct 5 08:13:08 PDT 2010


> I can't gauge the interest but it may be best to focus on events that may be
> feasible to implement on more than platform. You could define them in
> ExtendedWatchEventKind a bit like the extensions we have for modifiers
> already.

Thanks. I see your point and agree.

At the risk of sounding like a desperate software peddler, how about this idea?

A WatchEvent.Modifier implementation that enables you to register a
regular file (as opposed to a directory) with a WatchService.

E.g.,
    someRegularFile.register(watchService, watchEvents,
ExtendedWatchEventModifier.REGULAR_FILE);

I believe with the current WatchService implementation you would need
to filter any events received from a registered directory to look for
your one file of interest. I tested this concept on Linux but I'm
unsure if it would work with the native file system event facilities
on Windows or Solaris.


More information about the nio-dev mailing list