public class HighSensitivityRegistrar
extends java.lang.Object
WatchService to work ~reliably on MacOS where no native hooks but
polling is used.| Constructor and Description |
|---|
HighSensitivityRegistrar() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists() |
java.nio.file.WatchEvent.Modifier |
get()
Returns the SensitivityWatchEventModifier#HIGH if it exists (on sun jvms or
openjdk),
null otherwise. |
protected java.lang.Class<java.nio.file.WatchEvent.Modifier> |
getSensitivityWatchEventModifierClass()
Returns the class SensitivityWatchEventModifier if it exists.
|
protected boolean |
isMac()
Returns
true if the current this is running on is MacOS. |
boolean |
isRequired() |
void |
registerService(java.nio.file.Path path,
java.nio.file.WatchEvent.Kind<java.nio.file.Path>[] kinds,
java.nio.file.WatchService service) |
public boolean isRequired()
protected boolean isMac()
true if the current this is running on is MacOS. Returns false otherwise.
Method could be private but is kept protected for testing purposes.public boolean exists()
public java.nio.file.WatchEvent.Modifier get()
null otherwise.public void registerService(java.nio.file.Path path,
java.nio.file.WatchEvent.Kind<java.nio.file.Path>[] kinds,
java.nio.file.WatchService service)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.Class<java.nio.file.WatchEvent.Modifier> getSensitivityWatchEventModifierClass()
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException - if the modifier class could not be found