This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 7cccc191b5b4 CAMEL-23832: camel-file-watch - improve the component and
option descriptions (#30938)
7cccc191b5b4 is described below
commit 7cccc191b5b41cbbe27c214b436cca582984655c
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Nov 27 14:52:57 2026 +0100
CAMEL-23832: camel-file-watch - improve the component and option
descriptions (#30938)
This commit rewrites the component description, the texts of 10 endpoint
options (5 of them shared with the component)
and 9 headers of file-watch. The old CamelFileAbsolute,
CamelFileAbsolutePath and CamelFilePath texts were copied from
camel-file and spoke of relative paths and the move option, while this
consumer always sets absolute paths. The new
texts also say what the default file hasher reads at start and that
recursive=false still watches the whole tree.
Documentation only, no behavior change. The component JSON, the catalog
copy, the doc page header and the DSL are
regenerated. camel-file-watch is marked as done in
tasks/component-descriptions.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.../camel/catalog/components/file-watch.json | 50 +++---
.../camel/catalog/docs/file-watch-component.adoc | 2 +-
.../camel/component/file/watch/file-watch.json | 50 +++---
.../src/main/docs/file-watch-component.adoc | 2 +-
.../component/file/watch/FileWatchComponent.java | 28 ++--
.../component/file/watch/FileWatchConstants.java | 39 +++--
.../component/file/watch/FileWatchEndpoint.java | 52 ++++---
.../component/ComponentsBuilderFactory.java | 4 +-
.../dsl/FileWatchComponentBuilderFactory.java | 46 +++---
.../builder/endpoint/EndpointHeaderBuilders.java | 4 +-
.../builder/endpoint/StaticEndpointBuilders.java | 16 +-
.../dsl/FileWatchEndpointBuilderFactory.java | 169 ++++++++++++---------
tasks/component-descriptions.md | 2 +-
13 files changed, 262 insertions(+), 202 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/file-watch.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/file-watch.json
index 6f1dcd589a51..9ef62fc56de1 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/file-watch.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/file-watch.json
@@ -3,7 +3,7 @@
"kind": "component",
"name": "file-watch",
"title": "File Watch",
- "description": "Get notified about file events in a directory using
java.nio.file.WatchService.",
+ "description": "Receive an event when a file or directory is created,
modified or deleted in a directory of the file system.",
"deprecated": false,
"firstVersion": "3.0.0",
"label": "file",
@@ -25,41 +25,41 @@
},
"componentProperties": {
"bridgeErrorHandler": { "index": 0, "kind": "property", "displayName":
"Bridge Error Handler", "group": "consumer", "label": "consumer", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": false, "description":
"Allows for bridging the consumer to the Camel routing Error Handler, which
mean any exceptions (if possible) occurred while the Camel consumer is trying
to pickup incoming messages, or the like [...]
- "useFileHashing": { "index": 1, "kind": "property", "displayName": "Use
File Hashing", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Enables or disables file
hashing to detect duplicate events. If you disable this, you can get some
events multiple times on some platforms and JDKs. Check
java.nio.file.WatchService limitations for your target [...]
+ "useFileHashing": { "index": 1, "kind": "property", "displayName": "Use
File Hashing", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Whether to hash the
files with the fileHasher to drop duplicate events, as some platforms and JDKs
report a change more than once. If false, no file is hashed, and the route can
receive the same event more than [...]
"autowiredEnabled": { "index": 2, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching t [...]
- "concurrentConsumers": { "index": 3, "kind": "property", "displayName":
"Concurrent Consumers", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 1, "description": "The number of
concurrent consumers. Increase this value, if your route is slow to prevent
buffering in queue." },
- "fileHasher": { "index": 4, "kind": "property", "displayName": "File
Hasher", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "io.methvin.watcher.hashing.FileHasher", "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"#murmur3FFileHasher", "description": "Reference to
io.methvin.watcher.hashing.FileHasher. This prevents emitting duplicate events
on some platforms. For working with large files and if you dont need dete [...]
- "pollThreads": { "index": 5, "kind": "property", "displayName": "Poll
Threads", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "description": "The number of threads
polling WatchService. Increase this value, if you see OVERFLOW messages in
log." },
- "queueSize": { "index": 6, "kind": "property", "displayName": "Queue
Size", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 2147483647, "description": "Maximum size of
queue between WatchService and consumer. Unbounded by default. When the queue
is full, file events are dropped." }
+ "concurrentConsumers": { "index": 3, "kind": "property", "displayName":
"Concurrent Consumers", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 1, "description": "The number of
threads that take the events from the queue and route them. Increase it when
the route is slower than the events arrive. With more than one thread, the
events can be routed in another or [...]
+ "fileHasher": { "index": 4, "kind": "property", "displayName": "File
Hasher", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "io.methvin.watcher.hashing.FileHasher", "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"#murmur3FFileHasher", "description": "The
io.methvin.watcher.hashing.FileHasher that hashes each file to drop duplicate
events, such as a MODIFY event of a file whose hash did not change. The default
#mu [...]
+ "pollThreads": { "index": 5, "kind": "property", "displayName": "Poll
Threads", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "description": "The number of threads that
read the events from the watch service of the directory and put them in the
queue. Increase it when the log warns that an OVERFLOW occurred, which means
that the file system dropped events." },
+ "queueSize": { "index": 6, "kind": "property", "displayName": "Queue
Size", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 2147483647, "description": "The maximum number
of events in the queue between the pollThreads threads and the
concurrentConsumers threads. When the queue is full, new events are dropped and
a warning is logged once. A value of 0 or less me [...]
},
"headers": {
- "CamelFileEventType": { "index": 0, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "Type
of event. Possible values: CREATE, DELETE, MODIFY.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#EVENT_TYPE_HEADER" },
+ "CamelFileEventType": { "index": 0, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
type of the event: CREATE, MODIFY or DELETE.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#EVENT_TYPE_HEADER" },
"CamelFileNameOnly": { "index": 1, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "Only
the file name (the name with no leading paths).", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_NAME_ONLY" },
- "CamelFileAbsolute": { "index": 2, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "Boolean",
"deprecated": false, "autowired": false, "secret": false, "description": "A
boolean option specifying whether the consumed file denotes an absolute path or
not. Should normally be false for relative paths. Absolute paths should
normally not be used but we added to the move option to allow moving files to
absolute paths. But can be used el [...]
- "CamelFileAbsolutePath": { "index": 3, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
absolute path to the file. For relative files this path holds the relative path
instead.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_ABSOLUTE_PATH" },
- "CamelFilePath": { "index": 4, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
file path. For relative files this is the starting directory + the relative
filename. For absolute files this is the absolute path.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_PATH" },
- "CamelFileName": { "index": 5, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "important": true,
"description": "Name of the consumed file as a relative file path with offset
from the starting directory configured on the endpoint.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_NAME" },
- "CamelFileRelativePath": { "index": 6, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
relative path.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_RELATIVE_PATH" },
- "CamelFileNameConsumed": { "index": 7, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
name of the file that has been consumed", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_NAME_CONSUMED" },
- "CamelFileParent": { "index": 8, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
parent path.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_PARENT" },
- "CamelFileLastModified": { "index": 9, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "long",
"deprecated": false, "autowired": false, "secret": false, "description": "A
Long value containing the last modified timestamp of the file. Not set when the
file no longer exists, such as for a DELETE event.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_LAST_MODIFIED" }
+ "CamelFileAbsolute": { "index": 2, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "Boolean",
"deprecated": false, "autowired": false, "secret": false, "description":
"Always true, as the CamelFileAbsolutePath and CamelFilePath headers hold an
absolute path.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_ABSOLUTE" },
+ "CamelFileAbsolutePath": { "index": 3, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
absolute path of the file or directory of the event, normalized and with \/ as
separator.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_ABSOLUTE_PATH" },
+ "CamelFilePath": { "index": 4, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
absolute path of the file or directory of the event, the same value as the
CamelFileAbsolutePath header.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_PATH" },
+ "CamelFileName": { "index": 5, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "important": true,
"description": "The path of the file or directory of the event relative to the
directory of the path option, with \/ as separator.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_NAME" },
+ "CamelFileRelativePath": { "index": 6, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
path relative to the directory of the path option, the same value as the
CamelFileName header.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_RELATIVE_PATH" },
+ "CamelFileNameConsumed": { "index": 7, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
path relative to the directory of the path option, the same value as the
CamelFileName header.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_NAME_CONSUMED" },
+ "CamelFileParent": { "index": 8, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
absolute path of the directory that holds the file or directory of the event,
with \/ as separator.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_PARENT" },
+ "CamelFileLastModified": { "index": 9, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "long",
"deprecated": false, "autowired": false, "secret": false, "description": "The
last modified time of the file or directory, in milliseconds since the epoch.
Not set when the file no longer exists, such as for a DELETE event.",
"constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_LAST_MODIFIED" }
},
"bodyTypes": {
"consumerOut": { "carriers": [ "file" ], "javaType": "java.io.File",
"description": "The java.io.File of the file or directory of the event, also
for DELETE, with the event in the CamelFileEventType header. The consumer does
not read it: it converts to text, bytes or a stream by reading the file, which
fails after a DELETE" }
},
"properties": {
- "path": { "index": 0, "kind": "path", "displayName": "Path", "group":
"consumer", "label": "", "required": true, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "Path of directory to consume events from." },
- "antInclude": { "index": 1, "kind": "parameter", "displayName": "Ant
Include", "group": "consumer", "label": "", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": "**", "description": "ANT style pattern
to match files. The file is matched against path relative to endpoint path.
Pattern must be also relative (not starting with slash)" },
- "autoCreate": { "index": 2, "kind": "parameter", "displayName": "Auto
Create", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Auto create directory if
does not exist." },
- "events": { "index": 3, "kind": "parameter", "displayName": "Events",
"group": "consumer", "label": "", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "CREATE,MODIFY,DELETE", "description": "Comma
separated list of events to watch. Possible values: CREATE,MODIFY,DELETE" },
- "recursive": { "index": 4, "kind": "parameter", "displayName":
"Recursive", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Watch recursive in
current and child directories (including newly created directories)." },
- "useFileHashing": { "index": 5, "kind": "parameter", "displayName": "Use
File Hashing", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Enables or disables file
hashing to detect duplicate events. If you disable this, you can get some
events multiple times on some platforms and JDKs. Check
java.nio.file.WatchService limitations for your target [...]
+ "path": { "index": 0, "kind": "path", "displayName": "Path", "group":
"consumer", "label": "", "required": true, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "The directory to watch, as an absolute path or a path relative
to the working directory of the JVM. The consumer fails to start when the path
is not a directory, or when it does not exist and autoCreate is false." },
+ "antInclude": { "index": 1, "kind": "parameter", "displayName": "Ant
Include", "group": "consumer", "label": "", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": "**", "description": "An Ant-style
pattern, such as **\/*.txt, that the path of the file or directory relative to
the path option must match, with \/ as separator and no leading \/. The events
of the paths that do not match are drop [...]
+ "autoCreate": { "index": 2, "kind": "parameter", "displayName": "Auto
Create", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Whether the consumer
creates the directory, and its missing parent directories, when it does not
exist at start. If false, the consumer fails to start when the directory does
not exist." },
+ "events": { "index": 3, "kind": "parameter", "displayName": "Events",
"group": "consumer", "label": "", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "CREATE,MODIFY,DELETE", "description": "The
types of the events to receive, as a comma-separated list of CREATE, MODIFY and
DELETE in upper case and without spaces. The events of the other types are
dropped." },
+ "recursive": { "index": 4, "kind": "parameter", "displayName":
"Recursive", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Whether to receive the
events of the files and directories in all subdirectories, including the
subdirectories created later. If false, only the events of the entries directly
in the directory are received; the whole dire [...]
+ "useFileHashing": { "index": 5, "kind": "parameter", "displayName": "Use
File Hashing", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Whether to hash the
files with the fileHasher to drop duplicate events, as some platforms and JDKs
report a change more than once. If false, no file is hashed, and the route can
receive the same event more tha [...]
"bridgeErrorHandler": { "index": 6, "kind": "parameter", "displayName":
"Bridge Error Handler", "group": "consumer (advanced)", "label":
"consumer,advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions (if possible) occurred
while the Camel consumer is trying to pickup incoming [...]
"exceptionHandler": { "index": 7, "kind": "parameter", "displayName":
"Exception Handler", "group": "consumer (advanced)", "label":
"consumer,advanced", "required": false, "type": "object", "javaType":
"org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.",
"deprecated": false, "autowired": false, "secret": false, "description": "To
let the consumer use a custom ExceptionHandler. Notice if the option
bridgeErrorHandler is enabled then this option is not in use. By def [...]
"exchangePattern": { "index": 8, "kind": "parameter", "displayName":
"Exchange Pattern", "group": "consumer (advanced)", "label":
"consumer,advanced", "required": false, "type": "enum", "javaType":
"org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ],
"deprecated": false, "autowired": false, "secret": false, "description": "Sets
the exchange pattern when the consumer creates an exchange." },
- "concurrentConsumers": { "index": 9, "kind": "parameter", "displayName":
"Concurrent Consumers", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 1, "description": "The number of
concurrent consumers. Increase this value, if your route is slow to prevent
buffering in queue." },
- "fileHasher": { "index": 10, "kind": "parameter", "displayName": "File
Hasher", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "io.methvin.watcher.hashing.FileHasher", "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"#murmur3FFileHasher", "description": "Reference to
io.methvin.watcher.hashing.FileHasher. This prevents emitting duplicate events
on some platforms. For working with large files and if you dont need de [...]
- "pollThreads": { "index": 11, "kind": "parameter", "displayName": "Poll
Threads", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "description": "The number of threads
polling WatchService. Increase this value, if you see OVERFLOW messages in
log." },
- "queueSize": { "index": 12, "kind": "parameter", "displayName": "Queue
Size", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 2147483647, "description": "Maximum size of
queue between WatchService and consumer. Unbounded by default. When the queue
is full, file events are dropped." }
+ "concurrentConsumers": { "index": 9, "kind": "parameter", "displayName":
"Concurrent Consumers", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 1, "description": "The number of
threads that take the events from the queue and route them. Increase it when
the route is slower than the events arrive. With more than one thread, the
events can be routed in another o [...]
+ "fileHasher": { "index": 10, "kind": "parameter", "displayName": "File
Hasher", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "io.methvin.watcher.hashing.FileHasher", "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"#murmur3FFileHasher", "description": "The
io.methvin.watcher.hashing.FileHasher that hashes each file to drop duplicate
events, such as a MODIFY event of a file whose hash did not change. The default
# [...]
+ "pollThreads": { "index": 11, "kind": "parameter", "displayName": "Poll
Threads", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "description": "The number of threads that
read the events from the watch service of the directory and put them in the
queue. Increase it when the log warns that an OVERFLOW occurred, which means
that the file system dropped events." },
+ "queueSize": { "index": 12, "kind": "parameter", "displayName": "Queue
Size", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 2147483647, "description": "The maximum number
of events in the queue between the pollThreads threads and the
concurrentConsumers threads. When the queue is full, new events are dropped and
a warning is logged once. A value of 0 or less [...]
}
}
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/file-watch-component.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/file-watch-component.adoc
index ec1be4e66842..2e396c7035d0 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/file-watch-component.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/file-watch-component.adoc
@@ -2,7 +2,7 @@
:doctitle: File Watch
:shortname: file-watch
:artifactid: camel-file-watch
-:description: Get notified about file events in a directory using
java.nio.file.WatchService.
+:description: Receive an event when a file or directory is created, modified
or deleted in a directory of the file system.
:since: 3.0
:supportlevel: Stable
:tabs-sync-option:
diff --git
a/components/camel-file-watch/src/generated/resources/META-INF/org/apache/camel/component/file/watch/file-watch.json
b/components/camel-file-watch/src/generated/resources/META-INF/org/apache/camel/component/file/watch/file-watch.json
index 6f1dcd589a51..9ef62fc56de1 100644
---
a/components/camel-file-watch/src/generated/resources/META-INF/org/apache/camel/component/file/watch/file-watch.json
+++
b/components/camel-file-watch/src/generated/resources/META-INF/org/apache/camel/component/file/watch/file-watch.json
@@ -3,7 +3,7 @@
"kind": "component",
"name": "file-watch",
"title": "File Watch",
- "description": "Get notified about file events in a directory using
java.nio.file.WatchService.",
+ "description": "Receive an event when a file or directory is created,
modified or deleted in a directory of the file system.",
"deprecated": false,
"firstVersion": "3.0.0",
"label": "file",
@@ -25,41 +25,41 @@
},
"componentProperties": {
"bridgeErrorHandler": { "index": 0, "kind": "property", "displayName":
"Bridge Error Handler", "group": "consumer", "label": "consumer", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": false, "description":
"Allows for bridging the consumer to the Camel routing Error Handler, which
mean any exceptions (if possible) occurred while the Camel consumer is trying
to pickup incoming messages, or the like [...]
- "useFileHashing": { "index": 1, "kind": "property", "displayName": "Use
File Hashing", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Enables or disables file
hashing to detect duplicate events. If you disable this, you can get some
events multiple times on some platforms and JDKs. Check
java.nio.file.WatchService limitations for your target [...]
+ "useFileHashing": { "index": 1, "kind": "property", "displayName": "Use
File Hashing", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Whether to hash the
files with the fileHasher to drop duplicate events, as some platforms and JDKs
report a change more than once. If false, no file is hashed, and the route can
receive the same event more than [...]
"autowiredEnabled": { "index": 2, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching t [...]
- "concurrentConsumers": { "index": 3, "kind": "property", "displayName":
"Concurrent Consumers", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 1, "description": "The number of
concurrent consumers. Increase this value, if your route is slow to prevent
buffering in queue." },
- "fileHasher": { "index": 4, "kind": "property", "displayName": "File
Hasher", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "io.methvin.watcher.hashing.FileHasher", "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"#murmur3FFileHasher", "description": "Reference to
io.methvin.watcher.hashing.FileHasher. This prevents emitting duplicate events
on some platforms. For working with large files and if you dont need dete [...]
- "pollThreads": { "index": 5, "kind": "property", "displayName": "Poll
Threads", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "description": "The number of threads
polling WatchService. Increase this value, if you see OVERFLOW messages in
log." },
- "queueSize": { "index": 6, "kind": "property", "displayName": "Queue
Size", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 2147483647, "description": "Maximum size of
queue between WatchService and consumer. Unbounded by default. When the queue
is full, file events are dropped." }
+ "concurrentConsumers": { "index": 3, "kind": "property", "displayName":
"Concurrent Consumers", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 1, "description": "The number of
threads that take the events from the queue and route them. Increase it when
the route is slower than the events arrive. With more than one thread, the
events can be routed in another or [...]
+ "fileHasher": { "index": 4, "kind": "property", "displayName": "File
Hasher", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "io.methvin.watcher.hashing.FileHasher", "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"#murmur3FFileHasher", "description": "The
io.methvin.watcher.hashing.FileHasher that hashes each file to drop duplicate
events, such as a MODIFY event of a file whose hash did not change. The default
#mu [...]
+ "pollThreads": { "index": 5, "kind": "property", "displayName": "Poll
Threads", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "description": "The number of threads that
read the events from the watch service of the directory and put them in the
queue. Increase it when the log warns that an OVERFLOW occurred, which means
that the file system dropped events." },
+ "queueSize": { "index": 6, "kind": "property", "displayName": "Queue
Size", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 2147483647, "description": "The maximum number
of events in the queue between the pollThreads threads and the
concurrentConsumers threads. When the queue is full, new events are dropped and
a warning is logged once. A value of 0 or less me [...]
},
"headers": {
- "CamelFileEventType": { "index": 0, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "Type
of event. Possible values: CREATE, DELETE, MODIFY.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#EVENT_TYPE_HEADER" },
+ "CamelFileEventType": { "index": 0, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
type of the event: CREATE, MODIFY or DELETE.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#EVENT_TYPE_HEADER" },
"CamelFileNameOnly": { "index": 1, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "Only
the file name (the name with no leading paths).", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_NAME_ONLY" },
- "CamelFileAbsolute": { "index": 2, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "Boolean",
"deprecated": false, "autowired": false, "secret": false, "description": "A
boolean option specifying whether the consumed file denotes an absolute path or
not. Should normally be false for relative paths. Absolute paths should
normally not be used but we added to the move option to allow moving files to
absolute paths. But can be used el [...]
- "CamelFileAbsolutePath": { "index": 3, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
absolute path to the file. For relative files this path holds the relative path
instead.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_ABSOLUTE_PATH" },
- "CamelFilePath": { "index": 4, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
file path. For relative files this is the starting directory + the relative
filename. For absolute files this is the absolute path.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_PATH" },
- "CamelFileName": { "index": 5, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "important": true,
"description": "Name of the consumed file as a relative file path with offset
from the starting directory configured on the endpoint.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_NAME" },
- "CamelFileRelativePath": { "index": 6, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
relative path.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_RELATIVE_PATH" },
- "CamelFileNameConsumed": { "index": 7, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
name of the file that has been consumed", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_NAME_CONSUMED" },
- "CamelFileParent": { "index": 8, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
parent path.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_PARENT" },
- "CamelFileLastModified": { "index": 9, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "long",
"deprecated": false, "autowired": false, "secret": false, "description": "A
Long value containing the last modified timestamp of the file. Not set when the
file no longer exists, such as for a DELETE event.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_LAST_MODIFIED" }
+ "CamelFileAbsolute": { "index": 2, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "Boolean",
"deprecated": false, "autowired": false, "secret": false, "description":
"Always true, as the CamelFileAbsolutePath and CamelFilePath headers hold an
absolute path.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_ABSOLUTE" },
+ "CamelFileAbsolutePath": { "index": 3, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
absolute path of the file or directory of the event, normalized and with \/ as
separator.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_ABSOLUTE_PATH" },
+ "CamelFilePath": { "index": 4, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
absolute path of the file or directory of the event, the same value as the
CamelFileAbsolutePath header.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_PATH" },
+ "CamelFileName": { "index": 5, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "important": true,
"description": "The path of the file or directory of the event relative to the
directory of the path option, with \/ as separator.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_NAME" },
+ "CamelFileRelativePath": { "index": 6, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
path relative to the directory of the path option, the same value as the
CamelFileName header.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_RELATIVE_PATH" },
+ "CamelFileNameConsumed": { "index": 7, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
path relative to the directory of the path option, the same value as the
CamelFileName header.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_NAME_CONSUMED" },
+ "CamelFileParent": { "index": 8, "kind": "header", "displayName": "",
"group": "consumer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
absolute path of the directory that holds the file or directory of the event,
with \/ as separator.", "constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_PARENT" },
+ "CamelFileLastModified": { "index": 9, "kind": "header", "displayName":
"", "group": "consumer", "label": "", "required": false, "javaType": "long",
"deprecated": false, "autowired": false, "secret": false, "description": "The
last modified time of the file or directory, in milliseconds since the epoch.
Not set when the file no longer exists, such as for a DELETE event.",
"constantName":
"org.apache.camel.component.file.watch.FileWatchConstants#FILE_LAST_MODIFIED" }
},
"bodyTypes": {
"consumerOut": { "carriers": [ "file" ], "javaType": "java.io.File",
"description": "The java.io.File of the file or directory of the event, also
for DELETE, with the event in the CamelFileEventType header. The consumer does
not read it: it converts to text, bytes or a stream by reading the file, which
fails after a DELETE" }
},
"properties": {
- "path": { "index": 0, "kind": "path", "displayName": "Path", "group":
"consumer", "label": "", "required": true, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "Path of directory to consume events from." },
- "antInclude": { "index": 1, "kind": "parameter", "displayName": "Ant
Include", "group": "consumer", "label": "", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": "**", "description": "ANT style pattern
to match files. The file is matched against path relative to endpoint path.
Pattern must be also relative (not starting with slash)" },
- "autoCreate": { "index": 2, "kind": "parameter", "displayName": "Auto
Create", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Auto create directory if
does not exist." },
- "events": { "index": 3, "kind": "parameter", "displayName": "Events",
"group": "consumer", "label": "", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "CREATE,MODIFY,DELETE", "description": "Comma
separated list of events to watch. Possible values: CREATE,MODIFY,DELETE" },
- "recursive": { "index": 4, "kind": "parameter", "displayName":
"Recursive", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Watch recursive in
current and child directories (including newly created directories)." },
- "useFileHashing": { "index": 5, "kind": "parameter", "displayName": "Use
File Hashing", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Enables or disables file
hashing to detect duplicate events. If you disable this, you can get some
events multiple times on some platforms and JDKs. Check
java.nio.file.WatchService limitations for your target [...]
+ "path": { "index": 0, "kind": "path", "displayName": "Path", "group":
"consumer", "label": "", "required": true, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "The directory to watch, as an absolute path or a path relative
to the working directory of the JVM. The consumer fails to start when the path
is not a directory, or when it does not exist and autoCreate is false." },
+ "antInclude": { "index": 1, "kind": "parameter", "displayName": "Ant
Include", "group": "consumer", "label": "", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": "**", "description": "An Ant-style
pattern, such as **\/*.txt, that the path of the file or directory relative to
the path option must match, with \/ as separator and no leading \/. The events
of the paths that do not match are drop [...]
+ "autoCreate": { "index": 2, "kind": "parameter", "displayName": "Auto
Create", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Whether the consumer
creates the directory, and its missing parent directories, when it does not
exist at start. If false, the consumer fails to start when the directory does
not exist." },
+ "events": { "index": 3, "kind": "parameter", "displayName": "Events",
"group": "consumer", "label": "", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "CREATE,MODIFY,DELETE", "description": "The
types of the events to receive, as a comma-separated list of CREATE, MODIFY and
DELETE in upper case and without spaces. The events of the other types are
dropped." },
+ "recursive": { "index": 4, "kind": "parameter", "displayName":
"Recursive", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Whether to receive the
events of the files and directories in all subdirectories, including the
subdirectories created later. If false, only the events of the entries directly
in the directory are received; the whole dire [...]
+ "useFileHashing": { "index": 5, "kind": "parameter", "displayName": "Use
File Hashing", "group": "consumer", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "Whether to hash the
files with the fileHasher to drop duplicate events, as some platforms and JDKs
report a change more than once. If false, no file is hashed, and the route can
receive the same event more tha [...]
"bridgeErrorHandler": { "index": 6, "kind": "parameter", "displayName":
"Bridge Error Handler", "group": "consumer (advanced)", "label":
"consumer,advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions (if possible) occurred
while the Camel consumer is trying to pickup incoming [...]
"exceptionHandler": { "index": 7, "kind": "parameter", "displayName":
"Exception Handler", "group": "consumer (advanced)", "label":
"consumer,advanced", "required": false, "type": "object", "javaType":
"org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.",
"deprecated": false, "autowired": false, "secret": false, "description": "To
let the consumer use a custom ExceptionHandler. Notice if the option
bridgeErrorHandler is enabled then this option is not in use. By def [...]
"exchangePattern": { "index": 8, "kind": "parameter", "displayName":
"Exchange Pattern", "group": "consumer (advanced)", "label":
"consumer,advanced", "required": false, "type": "enum", "javaType":
"org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ],
"deprecated": false, "autowired": false, "secret": false, "description": "Sets
the exchange pattern when the consumer creates an exchange." },
- "concurrentConsumers": { "index": 9, "kind": "parameter", "displayName":
"Concurrent Consumers", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 1, "description": "The number of
concurrent consumers. Increase this value, if your route is slow to prevent
buffering in queue." },
- "fileHasher": { "index": 10, "kind": "parameter", "displayName": "File
Hasher", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "io.methvin.watcher.hashing.FileHasher", "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"#murmur3FFileHasher", "description": "Reference to
io.methvin.watcher.hashing.FileHasher. This prevents emitting duplicate events
on some platforms. For working with large files and if you dont need de [...]
- "pollThreads": { "index": 11, "kind": "parameter", "displayName": "Poll
Threads", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "description": "The number of threads
polling WatchService. Increase this value, if you see OVERFLOW messages in
log." },
- "queueSize": { "index": 12, "kind": "parameter", "displayName": "Queue
Size", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 2147483647, "description": "Maximum size of
queue between WatchService and consumer. Unbounded by default. When the queue
is full, file events are dropped." }
+ "concurrentConsumers": { "index": 9, "kind": "parameter", "displayName":
"Concurrent Consumers", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 1, "description": "The number of
threads that take the events from the queue and route them. Increase it when
the route is slower than the events arrive. With more than one thread, the
events can be routed in another o [...]
+ "fileHasher": { "index": 10, "kind": "parameter", "displayName": "File
Hasher", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "io.methvin.watcher.hashing.FileHasher", "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"#murmur3FFileHasher", "description": "The
io.methvin.watcher.hashing.FileHasher that hashes each file to drop duplicate
events, such as a MODIFY event of a file whose hash did not change. The default
# [...]
+ "pollThreads": { "index": 11, "kind": "parameter", "displayName": "Poll
Threads", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "description": "The number of threads that
read the events from the watch service of the directory and put them in the
queue. Increase it when the log warns that an OVERFLOW occurred, which means
that the file system dropped events." },
+ "queueSize": { "index": 12, "kind": "parameter", "displayName": "Queue
Size", "group": "advanced", "label": "advanced", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 2147483647, "description": "The maximum number
of events in the queue between the pollThreads threads and the
concurrentConsumers threads. When the queue is full, new events are dropped and
a warning is logged once. A value of 0 or less [...]
}
}
diff --git
a/components/camel-file-watch/src/main/docs/file-watch-component.adoc
b/components/camel-file-watch/src/main/docs/file-watch-component.adoc
index ec1be4e66842..2e396c7035d0 100644
--- a/components/camel-file-watch/src/main/docs/file-watch-component.adoc
+++ b/components/camel-file-watch/src/main/docs/file-watch-component.adoc
@@ -2,7 +2,7 @@
:doctitle: File Watch
:shortname: file-watch
:artifactid: camel-file-watch
-:description: Get notified about file events in a directory using
java.nio.file.WatchService.
+:description: Receive an event when a file or directory is created, modified
or deleted in a directory of the file system.
:since: 3.0
:supportlevel: Stable
:tabs-sync-option:
diff --git
a/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchComponent.java
b/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchComponent.java
index 8f16dc9ebb05..e156f1a7f16b 100644
---
a/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchComponent.java
+++
b/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchComponent.java
@@ -32,32 +32,38 @@ import org.apache.camel.support.DefaultComponent;
public class FileWatchComponent extends DefaultComponent {
@Metadata(label = "advanced",
- description = "The number of concurrent consumers. Increase this
value, if your route is slow to prevent buffering in queue.",
+ description = "The number of threads that take the events from
the queue and route them. Increase it when the"
+ + " route is slower than the events arrive. With
more than one thread, the events can be routed in"
+ + " another order than they occurred.",
defaultValue = "1")
private int concurrentConsumers = 1;
@Metadata(label = "advanced",
- description = "Maximum size of queue between WatchService and
consumer. Unbounded by default."
- + " When the queue is full, file events are
dropped.",
+ description = "The maximum number of events in the queue between
the pollThreads threads and the"
+ + " concurrentConsumers threads. When the queue is
full, new events are dropped and a warning is"
+ + " logged once. A value of 0 or less means no
limit.",
defaultValue = "" + Integer.MAX_VALUE)
private int queueSize = Integer.MAX_VALUE;
@Metadata(label = "advanced",
- description = "The number of threads polling WatchService.
Increase this value, if you see OVERFLOW messages in log.",
+ description = "The number of threads that read the events from
the watch service of the directory and put them in"
+ + " the queue. Increase it when the log warns that
an OVERFLOW occurred, which means that the file"
+ + " system dropped events.",
defaultValue = "1")
private int pollThreads = 1;
@Metadata(label = "advanced",
- description = "Reference to
io.methvin.watcher.hashing.FileHasher. "
- + "This prevents emitting duplicate events on some
platforms. "
- + "For working with large files and if you dont
need detect multiple modifications per second per file, "
- + "use #lastModifiedTimeFileHasher. You can also
provide custom implementation in registry.",
+ description = "The io.methvin.watcher.hashing.FileHasher that
hashes each file to drop duplicate events, such as"
+ + " a MODIFY event of a file whose hash did not
change. The default #murmur3FFileHasher hashes the"
+ + " content, and so reads every file in the
directory tree in full when the consumer starts;"
+ + " #lastModifiedTimeFileHasher uses the last
modified time instead, which suits large files. Not"
+ + " used when useFileHashing is false.",
defaultValue = "#murmur3FFileHasher")
private FileHasher fileHasher = FileHasher.DEFAULT_FILE_HASHER;
- @Metadata(description = "Enables or disables file hashing to detect
duplicate events. "
- + "If you disable this, you can get some events
multiple times on some platforms and JDKs. "
- + "Check java.nio.file.WatchService limitations
for your target platform.",
+ @Metadata(description = "Whether to hash the files with the fileHasher to
drop duplicate events, as some platforms and JDKs"
+ + " report a change more than once. If false, no
file is hashed, and the route can receive the same"
+ + " event more than once.",
defaultValue = "true")
private boolean useFileHashing = true;
diff --git
a/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConstants.java
b/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConstants.java
index f8afcabdd87f..89e97d10e951 100644
---
a/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConstants.java
+++
b/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConstants.java
@@ -21,41 +21,38 @@ import org.apache.camel.spi.Metadata;
public final class FileWatchConstants {
- @Metadata(description = "Type of event. Possible values: CREATE, DELETE,
MODIFY.", javaType = "String")
+ @Metadata(description = "The type of the event: CREATE, MODIFY or
DELETE.", javaType = "String")
public static final String EVENT_TYPE_HEADER = "CamelFileEventType";
@Metadata(description = "Only the file name (the name with no leading
paths).", javaType = "String")
public static final String FILE_NAME_ONLY = Exchange.FILE_NAME_ONLY;
- @Metadata(description = """
- A `boolean` option specifying whether the consumed file denotes an
- absolute path or not. Should normally be `false` for relative
paths.
- Absolute paths should normally not be used but we added to the move
- option to allow moving files to absolute paths. But can be used
- elsewhere as well.""",
+ @Metadata(description = "Always true, as the CamelFileAbsolutePath and
CamelFilePath headers hold an absolute path.",
javaType = "Boolean")
public static final String FILE_ABSOLUTE = "CamelFileAbsolute";
- @Metadata(description = """
- The absolute path to the file. For relative files this path holds
the
- relative path instead.""",
+ @Metadata(description = "The absolute path of the file or directory of the
event, normalized and with / as separator.",
javaType = "String")
public static final String FILE_ABSOLUTE_PATH = "CamelFileAbsolutePath";
- @Metadata(description = """
- The file path. For relative files this is the starting directory +
the
- relative filename. For absolute files this is the absolute
path.""",
+ @Metadata(description = "The absolute path of the file or directory of the
event, the same value as the"
+ + " CamelFileAbsolutePath header.",
javaType = "String")
public static final String FILE_PATH = Exchange.FILE_PATH;
- @Metadata(description = """
- Name of the consumed file as a relative file path with offset from
the
- starting directory configured on the endpoint.""",
+ @Metadata(description = "The path of the file or directory of the event
relative to the directory of the path option, with"
+ + " / as separator.",
javaType = "String", important = true)
public static final String FILE_NAME = Exchange.FILE_NAME;
- @Metadata(description = "The relative path.", javaType = "String")
+ @Metadata(description = "The path relative to the directory of the path
option, the same value as the CamelFileName"
+ + " header.",
+ javaType = "String")
public static final String FILE_RELATIVE_PATH = "CamelFileRelativePath";
- @Metadata(description = "The name of the file that has been consumed",
javaType = "String")
+ @Metadata(description = "The path relative to the directory of the path
option, the same value as the CamelFileName"
+ + " header.",
+ javaType = "String")
public static final String FILE_NAME_CONSUMED =
Exchange.FILE_NAME_CONSUMED;
- @Metadata(description = "The parent path.", javaType = "String")
+ @Metadata(description = "The absolute path of the directory that holds the
file or directory of the event, with / as"
+ + " separator.",
+ javaType = "String")
public static final String FILE_PARENT = Exchange.FILE_PARENT;
- @Metadata(description = "A `Long` value containing the last modified
timestamp of the file."
- + " Not set when the file no longer exists, such
as for a DELETE event.",
+ @Metadata(description = "The last modified time of the file or directory,
in milliseconds since the epoch. Not set when"
+ + " the file no longer exists, such as for a
DELETE event.",
javaType = "long")
public static final String FILE_LAST_MODIFIED =
Exchange.FILE_LAST_MODIFIED;
diff --git
a/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchEndpoint.java
b/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchEndpoint.java
index d2d184edad5d..4bdaf5c63a45 100644
---
a/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchEndpoint.java
+++
b/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchEndpoint.java
@@ -32,7 +32,7 @@ import org.apache.camel.spi.UriPath;
import org.apache.camel.support.DefaultEndpoint;
/**
- * Get notified about file events in a directory using {@link
java.nio.file.WatchService}.
+ * Receive an event when a file or directory is created, modified or deleted
in a directory of the file system.
*/
@UriEndpoint(firstVersion = "3.0.0", scheme = "file-watch", title = "File
Watch", syntax = "file-watch:path",
category = { Category.FILE }, consumerOnly = true, headersClass =
FileWatchConstants.class)
@@ -43,46 +43,58 @@ import org.apache.camel.support.DefaultEndpoint;
+ " after a DELETE"))
public class FileWatchEndpoint extends DefaultEndpoint implements
MultipleConsumersSupport {
- @UriPath(description = "Path of directory to consume events from.")
+ @UriPath(description = "The directory to watch, as an absolute path or a
path relative to the working directory of the JVM."
+ + " The consumer fails to start when the path is
not a directory, or when it does not exist and"
+ + " autoCreate is false.")
@Metadata(required = true)
private String path;
- @UriParam(description = "Comma separated list of events to watch. Possible
values: CREATE,MODIFY,DELETE",
+ @UriParam(description = "The types of the events to receive, as a
comma-separated list of CREATE, MODIFY and DELETE in"
+ + " upper case and without spaces. The events of
the other types are dropped.",
defaultValue = "CREATE,MODIFY,DELETE")
private String events = "CREATE,MODIFY,DELETE";
- @UriParam(description = "Auto create directory if does not exist.",
defaultValue = "true")
+ @UriParam(description = "Whether the consumer creates the directory, and
its missing parent directories, when it does not"
+ + " exist at start. If false, the consumer fails
to start when the directory does not exist.",
+ defaultValue = "true")
private boolean autoCreate = true;
- @UriParam(description = "Watch recursive in current and child directories
(including newly created directories).",
+ @UriParam(description = "Whether to receive the events of the files and
directories in all subdirectories, including the"
+ + " subdirectories created later. If false, only
the events of the entries directly in the"
+ + " directory are received; the whole directory
tree is still watched.",
defaultValue = "true")
private boolean recursive = true;
@UriParam(label = "advanced",
- description = "The number of concurrent consumers. Increase this
value, if your route is slow to prevent"
- + " buffering in queue.",
+ description = "The number of threads that take the events from
the queue and route them. Increase it when the"
+ + " route is slower than the events arrive. With
more than one thread, the events can be routed in"
+ + " another order than they occurred.",
defaultValue = "1")
private int concurrentConsumers;
@UriParam(label = "advanced",
- description = "The number of threads polling WatchService.
Increase this value, if you see OVERFLOW messages in"
- + " log.",
+ description = "The number of threads that read the events from
the watch service of the directory and put them in"
+ + " the queue. Increase it when the log warns that
an OVERFLOW occurred, which means that the file"
+ + " system dropped events.",
defaultValue = "1")
private int pollThreads;
- @UriParam(description = "ANT style pattern to match files. The file is
matched against path relative to endpoint path. "
- + "Pattern must be also relative (not starting
with slash)",
+ @UriParam(description = "An Ant-style pattern, such as **/*.txt, that the
path of the file or directory relative to the"
+ + " path option must match, with / as separator
and no leading /. The events of the paths that do"
+ + " not match are dropped, and an empty pattern
matches all paths.",
defaultValue = "**")
private String antInclude;
@UriParam(label = "advanced",
- description = "Maximum size of queue between WatchService and
consumer. Unbounded by default."
- + " When the queue is full, file events are
dropped.",
+ description = "The maximum number of events in the queue between
the pollThreads threads and the"
+ + " concurrentConsumers threads. When the queue is
full, new events are dropped and a warning is"
+ + " logged once. A value of 0 or less means no
limit.",
defaultValue = "" + Integer.MAX_VALUE)
private int queueSize;
@UriParam(label = "advanced",
- description = "Reference to
io.methvin.watcher.hashing.FileHasher. This prevents emitting duplicate events
on"
- + " some platforms. For working with large files
and if you dont need detect multiple modifications"
- + " per second per file, use
#lastModifiedTimeFileHasher. You can also provide custom"
- + " implementation in registry.",
+ description = "The io.methvin.watcher.hashing.FileHasher that
hashes each file to drop duplicate events, such as"
+ + " a MODIFY event of a file whose hash did not
change. The default #murmur3FFileHasher hashes the"
+ + " content, and so reads every file in the
directory tree in full when the consumer starts;"
+ + " #lastModifiedTimeFileHasher uses the last
modified time instead, which suits large files. Not"
+ + " used when useFileHashing is false.",
defaultValue = "#murmur3FFileHasher")
private FileHasher fileHasher;
- @UriParam(description = "Enables or disables file hashing to detect
duplicate events. "
- + "If you disable this, you can get some events
multiple times on some platforms and JDKs. "
- + "Check java.nio.file.WatchService limitations
for your target platform.",
+ @UriParam(description = "Whether to hash the files with the fileHasher to
drop duplicate events, as some platforms and JDKs"
+ + " report a change more than once. If false, no
file is hashed, and the route can receive the same"
+ + " event more than once.",
defaultValue = "true")
private boolean useFileHashing;
diff --git
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
index ee9c828d07c6..3baf432ce3eb 100644
---
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
+++
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
@@ -1848,8 +1848,8 @@ public interface ComponentsBuilderFactory {
}
/**
* File Watch (camel-file-watch)
- * Get notified about file events in a directory using
- * java.nio.file.WatchService.
+ * Receive an event when a file or directory is created, modified or
deleted
+ * in a directory of the file system.
*
* Category: file
* Since: 3.0
diff --git
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/FileWatchComponentBuilderFactory.java
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/FileWatchComponentBuilderFactory.java
index eca5a0cae7b1..10dea4e1ad3b 100644
---
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/FileWatchComponentBuilderFactory.java
+++
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/FileWatchComponentBuilderFactory.java
@@ -24,8 +24,8 @@ import org.apache.camel.builder.component.ComponentBuilder;
import org.apache.camel.component.file.watch.FileWatchComponent;
/**
- * Get notified about file events in a directory using
- * java.nio.file.WatchService.
+ * Receive an event when a file or directory is created, modified or deleted in
+ * a directory of the file system.
*
* Generated by camel build tools - do NOT edit this file!
*/
@@ -34,8 +34,8 @@ public interface FileWatchComponentBuilderFactory {
/**
* File Watch (camel-file-watch)
- * Get notified about file events in a directory using
- * java.nio.file.WatchService.
+ * Receive an event when a file or directory is created, modified or
deleted
+ * in a directory of the file system.
*
* Category: file
* Since: 3.0
@@ -82,10 +82,10 @@ public interface FileWatchComponentBuilderFactory {
/**
- * Enables or disables file hashing to detect duplicate events. If you
- * disable this, you can get some events multiple times on some
- * platforms and JDKs. Check java.nio.file.WatchService limitations for
- * your target platform.
+ * Whether to hash the files with the fileHasher to drop duplicate
+ * events, as some platforms and JDKs report a change more than once.
If
+ * false, no file is hashed, and the route can receive the same event
+ * more than once.
*
* The option is a: <code>boolean</code> type.
*
@@ -124,8 +124,10 @@ public interface FileWatchComponentBuilderFactory {
/**
- * The number of concurrent consumers. Increase this value, if your
- * route is slow to prevent buffering in queue.
+ * The number of threads that take the events from the queue and route
+ * them. Increase it when the route is slower than the events arrive.
+ * With more than one thread, the events can be routed in another order
+ * than they occurred.
*
* The option is a: <code>int</code> type.
*
@@ -142,11 +144,13 @@ public interface FileWatchComponentBuilderFactory {
/**
- * Reference to io.methvin.watcher.hashing.FileHasher. This prevents
- * emitting duplicate events on some platforms. For working with large
- * files and if you dont need detect multiple modifications per second
- * per file, use #lastModifiedTimeFileHasher. You can also provide
- * custom implementation in registry.
+ * The io.methvin.watcher.hashing.FileHasher that hashes each file to
+ * drop duplicate events, such as a MODIFY event of a file whose hash
+ * did not change. The default #murmur3FFileHasher hashes the content,
+ * and so reads every file in the directory tree in full when the
+ * consumer starts; #lastModifiedTimeFileHasher uses the last modified
+ * time instead, which suits large files. Not used when useFileHashing
+ * is false.
*
* The option is a:
* <code>io.methvin.watcher.hashing.FileHasher</code> type.
@@ -164,8 +168,10 @@ public interface FileWatchComponentBuilderFactory {
/**
- * The number of threads polling WatchService. Increase this value, if
- * you see OVERFLOW messages in log.
+ * The number of threads that read the events from the watch service of
+ * the directory and put them in the queue. Increase it when the log
+ * warns that an OVERFLOW occurred, which means that the file system
+ * dropped events.
*
* The option is a: <code>int</code> type.
*
@@ -182,8 +188,10 @@ public interface FileWatchComponentBuilderFactory {
/**
- * Maximum size of queue between WatchService and consumer. Unbounded
by
- * default. When the queue is full, file events are dropped.
+ * The maximum number of events in the queue between the pollThreads
+ * threads and the concurrentConsumers threads. When the queue is full,
+ * new events are dropped and a warning is logged once. A value of 0 or
+ * less means no limit.
*
* The option is a: <code>int</code> type.
*
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java
index 922716b29411..c8c04b175d09 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java
@@ -1452,8 +1452,8 @@ public class EndpointHeaderBuilders {
}
/**
* File Watch (camel-file-watch)
- * Get notified about file events in a directory using
- * java.nio.file.WatchService.
+ * Receive an event when a file or directory is created, modified or
deleted
+ * in a directory of the file system.
*
* Category: file
* Since: 3.0
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index 9ec1a8161d58..1e31129fa372 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -6031,8 +6031,8 @@ public class StaticEndpointBuilders {
}
/**
* File Watch (camel-file-watch)
- * Get notified about file events in a directory using
- * java.nio.file.WatchService.
+ * Receive an event when a file or directory is created, modified or
deleted
+ * in a directory of the file system.
*
* Category: file
* Since: 3.0
@@ -6041,7 +6041,9 @@ public class StaticEndpointBuilders {
* Syntax: <code>file-watch:path</code>
*
* Path parameter: path (required)
- * Path of directory to consume events from.
+ * The directory to watch, as an absolute path or a path relative to the
+ * working directory of the JVM. The consumer fails to start when the path
+ * is not a directory, or when it does not exist and autoCreate is false.
*
* @param path path
* @return the dsl builder
@@ -6051,8 +6053,8 @@ public class StaticEndpointBuilders {
}
/**
* File Watch (camel-file-watch)
- * Get notified about file events in a directory using
- * java.nio.file.WatchService.
+ * Receive an event when a file or directory is created, modified or
deleted
+ * in a directory of the file system.
*
* Category: file
* Since: 3.0
@@ -6061,7 +6063,9 @@ public class StaticEndpointBuilders {
* Syntax: <code>file-watch:path</code>
*
* Path parameter: path (required)
- * Path of directory to consume events from.
+ * The directory to watch, as an absolute path or a path relative to the
+ * working directory of the JVM. The consumer fails to start when the path
+ * is not a directory, or when it does not exist and autoCreate is false.
*
* @param componentName to use a custom component name for the endpoint
* instead of the default name
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FileWatchEndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FileWatchEndpointBuilderFactory.java
index 319e8fe71e79..53bdfded6f68 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FileWatchEndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FileWatchEndpointBuilderFactory.java
@@ -27,8 +27,8 @@ import org.apache.camel.builder.EndpointProducerBuilder;
import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
/**
- * Get notified about file events in a directory using
- * java.nio.file.WatchService.
+ * Receive an event when a file or directory is created, modified or deleted in
+ * a directory of the file system.
*
* Generated by camel build tools - do NOT edit this file!
*/
@@ -46,9 +46,10 @@ public interface FileWatchEndpointBuilderFactory {
}
/**
- * ANT style pattern to match files. The file is matched against path
- * relative to endpoint path. Pattern must be also relative (not
- * starting with slash).
+ * An Ant-style pattern, such as **/*.txt, that the path of the
file
+ * or directory relative to the path option must match, with / as
+ * separator and no leading /. The events of the paths that do not
match
+ * are dropped, and an empty pattern matches all paths.
*
* The option is a: <code>java.lang.String</code> type.
*
@@ -63,7 +64,9 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * Auto create directory if does not exist.
+ * Whether the consumer creates the directory, and its missing parent
+ * directories, when it does not exist at start. If false, the consumer
+ * fails to start when the directory does not exist.
*
* The option is a: <code>boolean</code> type.
*
@@ -78,7 +81,9 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * Auto create directory if does not exist.
+ * Whether the consumer creates the directory, and its missing parent
+ * directories, when it does not exist at start. If false, the consumer
+ * fails to start when the directory does not exist.
*
* The option will be converted to a <code>boolean</code> type.
*
@@ -93,8 +98,9 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * Comma separated list of events to watch. Possible values:
- * CREATE,MODIFY,DELETE.
+ * The types of the events to receive, as a comma-separated list of
+ * CREATE, MODIFY and DELETE in upper case and without spaces. The
+ * events of the other types are dropped.
*
* The option is a: <code>java.lang.String</code> type.
*
@@ -109,8 +115,10 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * Watch recursive in current and child directories (including newly
- * created directories).
+ * Whether to receive the events of the files and directories in all
+ * subdirectories, including the subdirectories created later. If
false,
+ * only the events of the entries directly in the directory are
+ * received; the whole directory tree is still watched.
*
* The option is a: <code>boolean</code> type.
*
@@ -125,8 +133,10 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * Watch recursive in current and child directories (including newly
- * created directories).
+ * Whether to receive the events of the files and directories in all
+ * subdirectories, including the subdirectories created later. If
false,
+ * only the events of the entries directly in the directory are
+ * received; the whole directory tree is still watched.
*
* The option will be converted to a <code>boolean</code> type.
*
@@ -141,10 +151,10 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * Enables or disables file hashing to detect duplicate events. If you
- * disable this, you can get some events multiple times on some
- * platforms and JDKs. Check java.nio.file.WatchService limitations for
- * your target platform.
+ * Whether to hash the files with the fileHasher to drop duplicate
+ * events, as some platforms and JDKs report a change more than once.
If
+ * false, no file is hashed, and the route can receive the same event
+ * more than once.
*
* The option is a: <code>boolean</code> type.
*
@@ -159,10 +169,10 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * Enables or disables file hashing to detect duplicate events. If you
- * disable this, you can get some events multiple times on some
- * platforms and JDKs. Check java.nio.file.WatchService limitations for
- * your target platform.
+ * Whether to hash the files with the fileHasher to drop duplicate
+ * events, as some platforms and JDKs report a change more than once.
If
+ * false, no file is hashed, and the route can receive the same event
+ * more than once.
*
* The option will be converted to a <code>boolean</code> type.
*
@@ -306,8 +316,10 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * The number of concurrent consumers. Increase this value, if your
- * route is slow to prevent buffering in queue.
+ * The number of threads that take the events from the queue and route
+ * them. Increase it when the route is slower than the events arrive.
+ * With more than one thread, the events can be routed in another order
+ * than they occurred.
*
* The option is a: <code>int</code> type.
*
@@ -322,8 +334,10 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * The number of concurrent consumers. Increase this value, if your
- * route is slow to prevent buffering in queue.
+ * The number of threads that take the events from the queue and route
+ * them. Increase it when the route is slower than the events arrive.
+ * With more than one thread, the events can be routed in another order
+ * than they occurred.
*
* The option will be converted to a <code>int</code> type.
*
@@ -338,11 +352,13 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * Reference to io.methvin.watcher.hashing.FileHasher. This prevents
- * emitting duplicate events on some platforms. For working with large
- * files and if you dont need detect multiple modifications per second
- * per file, use #lastModifiedTimeFileHasher. You can also provide
- * custom implementation in registry.
+ * The io.methvin.watcher.hashing.FileHasher that hashes each file to
+ * drop duplicate events, such as a MODIFY event of a file whose hash
+ * did not change. The default #murmur3FFileHasher hashes the content,
+ * and so reads every file in the directory tree in full when the
+ * consumer starts; #lastModifiedTimeFileHasher uses the last modified
+ * time instead, which suits large files. Not used when useFileHashing
+ * is false.
*
* The option is a: <code>io.methvin.watcher.hashing.FileHasher</code>
* type.
@@ -358,11 +374,13 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * Reference to io.methvin.watcher.hashing.FileHasher. This prevents
- * emitting duplicate events on some platforms. For working with large
- * files and if you dont need detect multiple modifications per second
- * per file, use #lastModifiedTimeFileHasher. You can also provide
- * custom implementation in registry.
+ * The io.methvin.watcher.hashing.FileHasher that hashes each file to
+ * drop duplicate events, such as a MODIFY event of a file whose hash
+ * did not change. The default #murmur3FFileHasher hashes the content,
+ * and so reads every file in the directory tree in full when the
+ * consumer starts; #lastModifiedTimeFileHasher uses the last modified
+ * time instead, which suits large files. Not used when useFileHashing
+ * is false.
*
* The option will be converted to a
* <code>io.methvin.watcher.hashing.FileHasher</code> type.
@@ -378,8 +396,10 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * The number of threads polling WatchService. Increase this value, if
- * you see OVERFLOW messages in log.
+ * The number of threads that read the events from the watch service of
+ * the directory and put them in the queue. Increase it when the log
+ * warns that an OVERFLOW occurred, which means that the file system
+ * dropped events.
*
* The option is a: <code>int</code> type.
*
@@ -394,8 +414,10 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * The number of threads polling WatchService. Increase this value, if
- * you see OVERFLOW messages in log.
+ * The number of threads that read the events from the watch service of
+ * the directory and put them in the queue. Increase it when the log
+ * warns that an OVERFLOW occurred, which means that the file system
+ * dropped events.
*
* The option will be converted to a <code>int</code> type.
*
@@ -410,8 +432,10 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * Maximum size of queue between WatchService and consumer. Unbounded
by
- * default. When the queue is full, file events are dropped.
+ * The maximum number of events in the queue between the pollThreads
+ * threads and the concurrentConsumers threads. When the queue is full,
+ * new events are dropped and a warning is logged once. A value of 0 or
+ * less means no limit.
*
* The option is a: <code>int</code> type.
*
@@ -426,8 +450,10 @@ public interface FileWatchEndpointBuilderFactory {
return this;
}
/**
- * Maximum size of queue between WatchService and consumer. Unbounded
by
- * default. When the queue is full, file events are dropped.
+ * The maximum number of events in the queue between the pollThreads
+ * threads and the concurrentConsumers threads. When the queue is full,
+ * new events are dropped and a warning is logged once. A value of 0 or
+ * less means no limit.
*
* The option will be converted to a <code>int</code> type.
*
@@ -446,8 +472,8 @@ public interface FileWatchEndpointBuilderFactory {
public interface FileWatchBuilders {
/**
* File Watch (camel-file-watch)
- * Get notified about file events in a directory using
- * java.nio.file.WatchService.
+ * Receive an event when a file or directory is created, modified or
+ * deleted in a directory of the file system.
*
* Category: file
* Since: 3.0
@@ -460,8 +486,8 @@ public interface FileWatchEndpointBuilderFactory {
}
/**
* File Watch (camel-file-watch)
- * Get notified about file events in a directory using
- * java.nio.file.WatchService.
+ * Receive an event when a file or directory is created, modified or
+ * deleted in a directory of the file system.
*
* Category: file
* Since: 3.0
@@ -470,7 +496,10 @@ public interface FileWatchEndpointBuilderFactory {
* Syntax: <code>file-watch:path</code>
*
* Path parameter: path (required)
- * Path of directory to consume events from.
+ * The directory to watch, as an absolute path or a path relative to
the
+ * working directory of the JVM. The consumer fails to start when the
+ * path is not a directory, or when it does not exist and autoCreate is
+ * false.
*
* @param path path
* @return the dsl builder
@@ -480,8 +509,8 @@ public interface FileWatchEndpointBuilderFactory {
}
/**
* File Watch (camel-file-watch)
- * Get notified about file events in a directory using
- * java.nio.file.WatchService.
+ * Receive an event when a file or directory is created, modified or
+ * deleted in a directory of the file system.
*
* Category: file
* Since: 3.0
@@ -490,7 +519,10 @@ public interface FileWatchEndpointBuilderFactory {
* Syntax: <code>file-watch:path</code>
*
* Path parameter: path (required)
- * Path of directory to consume events from.
+ * The directory to watch, as an absolute path or a path relative to
the
+ * working directory of the JVM. The consumer fails to start when the
+ * path is not a directory, or when it does not exist and autoCreate is
+ * false.
*
* @param componentName to use a custom component name for the endpoint
* instead of the default name
@@ -513,7 +545,7 @@ public interface FileWatchEndpointBuilderFactory {
public static final FileWatchHeaderNameBuilder INSTANCE = new
FileWatchHeaderNameBuilder();
/**
- * Type of event. Possible values: CREATE, DELETE, MODIFY.
+ * The type of the event: CREATE, MODIFY or DELETE.
*
* The option is a: {@code String} type.
*
@@ -537,11 +569,8 @@ public interface FileWatchEndpointBuilderFactory {
return "CamelFileNameOnly";
}
/**
- * A boolean option specifying whether the consumed file denotes an
- * absolute path or not. Should normally be false for relative paths.
- * Absolute paths should normally not be used but we added to the move
- * option to allow moving files to absolute paths. But can be used
- * elsewhere as well.
+ * Always true, as the CamelFileAbsolutePath and CamelFilePath headers
+ * hold an absolute path.
*
* The option is a: {@code Boolean} type.
*
@@ -553,8 +582,8 @@ public interface FileWatchEndpointBuilderFactory {
return "CamelFileAbsolute";
}
/**
- * The absolute path to the file. For relative files this path holds
the
- * relative path instead.
+ * The absolute path of the file or directory of the event, normalized
+ * and with / as separator.
*
* The option is a: {@code String} type.
*
@@ -566,8 +595,8 @@ public interface FileWatchEndpointBuilderFactory {
return "CamelFileAbsolutePath";
}
/**
- * The file path. For relative files this is the starting directory +
- * the relative filename. For absolute files this is the absolute path.
+ * The absolute path of the file or directory of the event, the same
+ * value as the CamelFileAbsolutePath header.
*
* The option is a: {@code String} type.
*
@@ -579,8 +608,8 @@ public interface FileWatchEndpointBuilderFactory {
return "CamelFilePath";
}
/**
- * Name of the consumed file as a relative file path with offset from
- * the starting directory configured on the endpoint.
+ * The path of the file or directory of the event relative to the
+ * directory of the path option, with / as separator.
*
* The option is a: {@code String} type.
*
@@ -592,7 +621,8 @@ public interface FileWatchEndpointBuilderFactory {
return "CamelFileName";
}
/**
- * The relative path.
+ * The path relative to the directory of the path option, the same
value
+ * as the CamelFileName header.
*
* The option is a: {@code String} type.
*
@@ -604,7 +634,8 @@ public interface FileWatchEndpointBuilderFactory {
return "CamelFileRelativePath";
}
/**
- * The name of the file that has been consumed.
+ * The path relative to the directory of the path option, the same
value
+ * as the CamelFileName header.
*
* The option is a: {@code String} type.
*
@@ -616,7 +647,8 @@ public interface FileWatchEndpointBuilderFactory {
return "CamelFileNameConsumed";
}
/**
- * The parent path.
+ * The absolute path of the directory that holds the file or directory
+ * of the event, with / as separator.
*
* The option is a: {@code String} type.
*
@@ -628,8 +660,9 @@ public interface FileWatchEndpointBuilderFactory {
return "CamelFileParent";
}
/**
- * A Long value containing the last modified timestamp of the file. Not
- * set when the file no longer exists, such as for a DELETE event.
+ * The last modified time of the file or directory, in milliseconds
+ * since the epoch. Not set when the file no longer exists, such as for
+ * a DELETE event.
*
* The option is a: {@code long} type.
*
diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md
index c2a6ce853f1e..b1232c036c1b 100644
--- a/tasks/component-descriptions.md
+++ b/tasks/component-descriptions.md
@@ -173,7 +173,7 @@ or removes its row.
| camel-exec | exec | |
| camel-fhir | fhir | |
| camel-file | file | |
-| camel-file-watch | file-watch | |
+| camel-file-watch | file-watch | yes |
| camel-flatpack | flatpack | |
| camel-flink | flink | |
| camel-flowable | flowable | |