You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,11 @@ A Java file watcher that works across platforms and supports recursion, single f
10
10
Features:
11
11
12
12
- monitor a single file (or directory) for changes
13
-
- monitor a directory for changes to its direct descendants
13
+
- monitor a directory for changes to its direct children
14
14
- monitor a directory for changes for all its descendants (aka recursive directory watch)
15
+
- backends supported:
16
+
- the JDK [`WatchService`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/WatchService.html) API on any platform
17
+
- the native [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) API on macOS
15
18
- edge cases dealt with:
16
19
- recursive watches will also continue in new directories
17
20
- multiple watches for the same directory are merged to avoid overloading the kernel
@@ -61,8 +64,8 @@ try(var active = watcherSetup.start()) {
61
64
62
65
On all platforms except macOS, the library internally uses the JDK default implementation of the Java NIO [`WatchService`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/WatchService.html) API.
63
66
64
-
On macOS, the library internally uses our custom `WatchService` implementation based on macOS's native [file system event streams](https://developer.apple.com/documentation/coreservices/file_system_events?language=objc) (using JNA).
65
-
Generally, it offers better performance than the JDK default implementation (because the latter uses a polling loop to detect changes only once every two seconds).
67
+
On macOS, the library internally uses our custom `WatchService` implementation based on macOS's native [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) API.
68
+
Generally, it offers better performance than the JDK default implementation (because the latter uses a polling loop to detect changes at fixed time intervals).
66
69
To force the library to use the JDK default implementation on macOS, set system property `engineering.swat.java-watch.mac` to `jdk`.
0 commit comments