For OS X there is no native WatchService
implementation in the JDKs 7, 8 and 9. I would like to be able to use both the WatchService
interface transparently and have native file watching instead of polling on OS X.
Is there a way I can provide a new WatchService
for OS X? I would like to do this transparently instead of on every place where I ask for a WatchService
with:
WatchService watcher = FileSystems.getDefault().newWatchService();
A suggested fix is to add the SensitivityWatchEventModifier.HIGH
argument to calls to register. However, this value comes from sun packages and is only available on the Oracle JDK and I would prefer not to have such a dependency.