File Watch
JVM since1.0.0 Native since1.0.0
Get notified about file events in a directory using java.nio.file.WatchService.
What’s inside
-
File Watch component, URI syntax:
file-watch:path
Please refer to the above link for usage and configuration details.
Maven coordinates
Or add the coordinates to your existing project:
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-file-watch</artifactId>
</dependency>
Check the User guide for more information about writing Camel Quarkus applications.
Camel Quarkus limitations
The underlying Camel component configures the Directory Watcher in a platform specific way:
-
On Mac, the
io.methvin.watchservice.MacOSXListeningWatchService
is used that depends onnet.java.dev.jna:jna
. -
Other platforms use
java.nio.file.WatchService
provided by the Java Runtime.
Because JNA is not supported on GraalVM yet, we made the component to behave differently on Camel Quarkus: We are substituting the respective Directory Watcher method do use the stock java.nio.file.WatchService
also on Mac.