// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-file-watch"]
= File Watch
:page-aliases: extensions/file-watch.adoc
:linkattrs:
:cq-artifact-id: camel-quarkus-file-watch
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Get notified about file events in a directory using java.nio.file.WatchService.
:cq-deprecated: false
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##
endif::[]

Get notified about file events in a directory using java.nio.file.WatchService.

[id="extensions-file-watch-whats-inside"]
== What's inside

* xref:{cq-camel-components}::file-watch-component.adoc[File Watch component], URI syntax: `file-watch:path`

Please refer to the above link for usage and configuration details.

[id="extensions-file-watch-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-file-watch[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-file-watch</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-file-watch-camel-quarkus-limitations"]
== Camel Quarkus limitations

[id="extensions-file-watch-limitations-macos-native-mode-limitations"]
=== macOS native mode limitations

Depending on the platform, the underlying Camel component configures the Directory Watcher differently in native mode.

On macOS, a `WatchService` implementation based on JNA is used to access native filesystem events. This provides better performance and scalability, compared to the JDK’s default macOS implementation.

Since JNA is not supported on GraalVM, `camel-quarkus-file-watch` cannot use the macOS-specific native `WatchService`. To maintain compatibility, the `WatchService` is forcefully overridden to `java.nio.file.WatchService`. This implementation may be slower compared to the JNA-based version.

