This is an automated email from the ASF dual-hosted git repository.

oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new 8d04197f2 chore: the FTP and SFTP sinks can write a file under a 
temporary name, and a done file (#3170) (#3199)
8d04197f2 is described below

commit 8d04197f22c1e68ad5f7eebaebf94b4d9f182dea
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Nov 18 15:12:49 2026 +0100

    chore: the FTP and SFTP sinks can write a file under a temporary name, and 
a done file (#3170) (#3199)
    
    ftp-sink, ftps-sink and sftp-sink uploaded each file under its real name
    from the start, so a reader polling the directory could pick up a
    half-written file. They now take two optional options:
    
    - tempPrefix: upload under a temporary name (prefix + file name) and
      rename to the real name once complete. A dot prefix such as `.tmp-`
      works with ftp-source, ftps-source and sftp-source as they are, since
      Camel readers skip dot names. A prefix ending with `/` uploads into a
      subdirectory first.
    - doneFileName: write an empty done file next to each file once it is
      complete; only ${file:name} and ${file:name.noext} are allowed in it.
    
    tempPrefix is offered rather than tempFileName: it is plain text, it
    cannot point the temporary file outside the target directory of the
    file through the file name, and it avoids the ${file:name} trap of
    tempFileName, which doubles the subdirectory of a CamelFileName with a
    path.
    
    Both are mapped as RAW({{?...}}), with no default, so that with them
    unset the endpoint URI is identical to before (checked with
    `camel get endpoint`), and so that `+` or `%20` in a value is kept as
    written. The option and Good to know descriptions say how they combine
    with fileExist (Append with tempPrefix fails every message; Override
    deletes the old file when the upload starts), and each partial page
    has an example.
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 .../ROOT/partials/ftp-sink-description.adoc        | 38 ++++++++++++++++++++++
 .../ROOT/partials/ftps-sink-description.adoc       | 38 ++++++++++++++++++++++
 .../ROOT/partials/sftp-sink-description.adoc       | 38 +++++++++++++++++++++-
 kamelets/ftp-sink.kamelet.yaml                     | 14 +++++++-
 kamelets/ftps-sink.kamelet.yaml                    | 14 +++++++-
 kamelets/sftp-sink.kamelet.yaml                    | 14 +++++++-
 .../main/resources/META-INF/kamelets-index.json    |  6 ++--
 .../main/resources/kamelets/ftp-sink.kamelet.yaml  | 14 +++++++-
 .../main/resources/kamelets/ftps-sink.kamelet.yaml | 14 +++++++-
 .../main/resources/kamelets/sftp-sink.kamelet.yaml | 14 +++++++-
 10 files changed, 194 insertions(+), 10 deletions(-)

diff --git a/docs/modules/ROOT/partials/ftp-sink-description.adoc 
b/docs/modules/ROOT/partials/ftp-sink-description.adoc
index 03cf0d3f8..1a8b34380 100644
--- a/docs/modules/ROOT/partials/ftp-sink-description.adoc
+++ b/docs/modules/ROOT/partials/ftp-sink-description.adoc
@@ -18,6 +18,8 @@ Requires:
 - **Passive Mode**: Can be enabled for firewall compatibility
 - **File Existence Handling**: Override (default), Append, Fail, or Ignore
 - **Auto-create Directories**: Automatically creates missing directories 
(enabled by default)
+- **Temporary Name Prefix**: Upload each file under a temporary name, such as 
`.tmp-orders.csv`, and rename it to its real name once it is complete (not set 
by default)
+- **Done File Name**: Write an empty done file next to each file once it is 
complete, such as `orders.csv.done` (not set by default)
 
 === Optional Headers
 
@@ -28,3 +30,39 @@ If you do not set the property in the header, the Kamelet 
uses a default naming
 The value is reduced to a single file name before use: any directory component 
is
 dropped, so `reports/2026/data.csv` is stored as `data.csv`. The file is always
 written inside the configured directory.
+
+=== Example with a Temporary Name and a Done File
+
+By default a file is uploaded under its real name from the start, so a reader 
that polls the directory can pick it up
+half-written. Set **tempPrefix**, **doneFileName**, or both, to prevent that:
+
+[source,yaml,subs='+attributes,macros']
+----
+- route:
+    from:
+      uri: "timer:tick"
+      parameters:
+        period: 60000
+      steps:
+        - setBody:
+            constant: "order-1,42"
+        - setHeader:
+            name: file
+            constant: "orders.csv"
+        - to:
+            uri: "kamelet:ftp-sink"
+            parameters:
+              connectionHost: "ftp.example.com"
+              username: "ftpuser"
+              password: "ftppass"
+              directoryName: "/incoming"
+              tempPrefix: ".tmp-"
+              doneFileName: "${file:name}.done"
+----
+
+Each file is uploaded as `.tmp-orders.csv` and renamed to `orders.csv` once 
the upload is complete, and then an empty
+`orders.csv.done` is written next to it. The FTP Source Kamelet, like other 
readers built with Camel, skips the names that start
+with a dot, so it never reads a half-written file; another reader can wait for 
the `.done` file. In **doneFileName**,
+`${file:name}` stands for the name of the file and `${file:name.noext}` for 
the name without its extension; no other
+`${...}` is allowed. The user needs the right to rename files on the server. 
**tempPrefix** cannot be combined with
+**fileExist** set to `Append`, and with `Override` a file of the same name is 
deleted when the upload starts.
diff --git a/docs/modules/ROOT/partials/ftps-sink-description.adoc 
b/docs/modules/ROOT/partials/ftps-sink-description.adoc
index bf6fa1466..037f3221c 100644
--- a/docs/modules/ROOT/partials/ftps-sink-description.adoc
+++ b/docs/modules/ROOT/partials/ftps-sink-description.adoc
@@ -22,6 +22,8 @@ Requires:
 - **Passive Mode**: Can be enabled for firewall compatibility
 - **File Existence Handling**: Override (default), Append, Fail, or Ignore
 - **Auto-create Directories**: Automatically creates missing directories 
(enabled by default)
+- **Temporary Name Prefix**: Upload each file under a temporary name, such as 
`.tmp-orders.csv`, and rename it to its real name once it is complete (not set 
by default)
+- **Done File Name**: Write an empty done file next to each file once it is 
complete, such as `orders.csv.done` (not set by default)
 
 === Optional Headers
 
@@ -32,3 +34,39 @@ If you do not set the property in the header, the Kamelet 
uses a default naming
 The value is reduced to a single file name before use: any directory component 
is
 dropped, so `reports/2026/data.csv` is stored as `data.csv`. The file is always
 written inside the configured directory.
+
+=== Example with a Temporary Name and a Done File
+
+By default a file is uploaded under its real name from the start, so a reader 
that polls the directory can pick it up
+half-written. Set **tempPrefix**, **doneFileName**, or both, to prevent that:
+
+[source,yaml,subs='+attributes,macros']
+----
+- route:
+    from:
+      uri: "timer:tick"
+      parameters:
+        period: 60000
+      steps:
+        - setBody:
+            constant: "order-1,42"
+        - setHeader:
+            name: file
+            constant: "orders.csv"
+        - to:
+            uri: "kamelet:ftps-sink"
+            parameters:
+              connectionHost: "ftps.example.com"
+              username: "ftpuser"
+              password: "ftppass"
+              directoryName: "/incoming"
+              tempPrefix: ".tmp-"
+              doneFileName: "${file:name}.done"
+----
+
+Each file is uploaded as `.tmp-orders.csv` and renamed to `orders.csv` once 
the upload is complete, and then an empty
+`orders.csv.done` is written next to it. The FTPS Source Kamelet, like other 
readers built with Camel, skips the names that start
+with a dot, so it never reads a half-written file; another reader can wait for 
the `.done` file. In **doneFileName**,
+`${file:name}` stands for the name of the file and `${file:name.noext}` for 
the name without its extension; no other
+`${...}` is allowed. The user needs the right to rename files on the server. 
**tempPrefix** cannot be combined with
+**fileExist** set to `Append`, and with `Override` a file of the same name is 
deleted when the upload starts.
diff --git a/docs/modules/ROOT/partials/sftp-sink-description.adoc 
b/docs/modules/ROOT/partials/sftp-sink-description.adoc
index ec11727f7..b57d6fbce 100644
--- a/docs/modules/ROOT/partials/sftp-sink-description.adoc
+++ b/docs/modules/ROOT/partials/sftp-sink-description.adoc
@@ -10,7 +10,7 @@ Built on top of SSH protocol, SFTP provides strong 
authentication and encryption
 
 === File Operations
 
-The sink uploads each message as a file into `directoryName`, and creates 
missing directories when `autoCreate` is true. What happens when the file 
already exists is set by `fileExist` (`Override`, `Append`, `Fail` or 
`Ignore`). To read files from an SFTP server, use the SFTP Source Kamelet.
+The sink uploads each message as a file into `directoryName`, and creates 
missing directories when `autoCreate` is true. What happens when the file 
already exists is set by `fileExist` (`Override`, `Append`, `Fail` or 
`Ignore`). To keep a reader from picking up a half-written file, `tempPrefix` 
uploads each file under a temporary name and renames it once it is complete, 
and `doneFileName` writes an empty done file next to it; see the example below. 
To read files from an SFTP server, use  [...]
 
 === Authentication Methods
 
@@ -33,3 +33,39 @@ If you do not set the property in the header, the Kamelet 
uses a default naming
 The value is reduced to a single file name before use: any directory component 
is
 dropped, so `reports/2026/data.csv` is stored as `data.csv`. The file is always
 written inside the configured directory.
+
+=== Example with a Temporary Name and a Done File
+
+By default a file is uploaded under its real name from the start, so a reader 
that polls the directory can pick it up
+half-written. Set **tempPrefix**, **doneFileName**, or both, to prevent that:
+
+[source,yaml,subs='+attributes,macros']
+----
+- route:
+    from:
+      uri: "timer:tick"
+      parameters:
+        period: 60000
+      steps:
+        - setBody:
+            constant: "order-1,42"
+        - setHeader:
+            name: file
+            constant: "orders.csv"
+        - to:
+            uri: "kamelet:sftp-sink"
+            parameters:
+              connectionHost: "sftp.example.com"
+              username: "sftpuser"
+              password: "sftppass"
+              directoryName: "/incoming"
+              tempPrefix: ".tmp-"
+              doneFileName: "${file:name}.done"
+----
+
+Each file is uploaded as `.tmp-orders.csv` and renamed to `orders.csv` once 
the upload is complete, and then an empty
+`orders.csv.done` is written next to it. The SFTP Source Kamelet, like other 
readers built with Camel, skips the names that start
+with a dot, so it never reads a half-written file; another reader can wait for 
the `.done` file. In **doneFileName**,
+`${file:name}` stands for the name of the file and `${file:name.noext}` for 
the name without its extension; no other
+`${...}` is allowed. The user needs the right to rename files on the server. 
**tempPrefix** cannot be combined with
+**fileExist** set to `Append`, and with `Override` a file of the same name is 
deleted when the upload starts.
diff --git a/kamelets/ftp-sink.kamelet.yaml b/kamelets/ftp-sink.kamelet.yaml
index 843f487e4..26d78a507 100644
--- a/kamelets/ftp-sink.kamelet.yaml
+++ b/kamelets/ftp-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the message is unchanged. The `CamelFileNameProduced` header is 
set to the path of the file on the server.
 
-      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. The connection and the login are not encrypted. A file name 
that points outside `directoryName` fails the message. Files are sent in ASCII 
(text) mode unless `binary` is true.
+      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. A file is uploaded under its real name from the start, so a 
reader that polls the directory can pick it up half-written. To prevent that, 
set `tempPrefix` to upload it under a temporary name and rename it once it is 
complete, or `doneFileName` to write an empty done file next to it once it is 
complete. The connection and the login are not encrypted. A file name that 
points outside `directoryName [...]
     required:
       - connectionHost
       - connectionPort
@@ -97,6 +97,16 @@ spec:
         description: If true, `directoryName`, and any subdirectory in the 
`CamelFileName` header, is created on the server when it does not exist.
         type: boolean
         default: true
+      tempPrefix:
+        title: Temporary Name Prefix
+        description: A prefix for the name a file is uploaded under. Once the 
upload is complete, the file is renamed to its real name, so a reader that 
skips the names with this prefix never picks up a half-written file. 
`ftp-source`, like other readers built with Camel, skips the names that start 
with a dot, so a prefix such as `.tmp-`, which uploads `orders.csv` as 
`.tmp-orders.csv`, works with it as it is. A prefix that ends with `/`, such as 
`.inprogress/`, uploads the file into tha [...]
+        type: string
+        example: ".tmp-"
+      doneFileName:
+        title: Done File Name
+        description: The name of an empty file to write next to each file once 
the file is complete, so that a reader knows the file can be read. 
`$\{file:name}` stands for the name of the file and `$\{file:name.noext}` for 
the name without its extension, so `$\{file:name}.done` writes 
`orders.csv.done`, and `$\{file:name.noext}.ready` writes `orders.ready`. A 
fixed name, such as `ready`, is written again after each file. No other 
`$\{...}` is allowed, and with one the file is uploaded b [...]
+        type: string
+        example: "${file:name}.done"
   dataTypes:
     in:
       headers:
@@ -161,8 +171,10 @@ spec:
               host: "{{username}}@{{connectionHost}}"
               port: "{{connectionPort}}"
               directoryName: "{{directoryName}}"
+              doneFileName: "RAW({{?doneFileName}})"
               autoCreate: "{{autoCreate}}"
               binary: "{{binary}}"
               fileExist: "{{fileExist}}"
               passiveMode: "{{passiveMode}}"
               password: "RAW({{password}})"
+              tempPrefix: "RAW({{?tempPrefix}})"
diff --git a/kamelets/ftps-sink.kamelet.yaml b/kamelets/ftps-sink.kamelet.yaml
index 06bde059e..1636b2980 100644
--- a/kamelets/ftps-sink.kamelet.yaml
+++ b/kamelets/ftps-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the message is unchanged. The `CamelFileNameProduced` header is 
set to the path of the file on the server.
 
-      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. It uses explicit TLS: it connects to the normal FTP port, 
usually 21, and then switches to TLS. A server that only accepts implicit TLS, 
usually on port 990, is not supported. A file name that points outside 
`directoryName` fails the message. Files are sent in ASCII (text) mode unless 
`binary` is true.
+      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. A file is uploaded under its real name from the start, so a 
reader that polls the directory can pick it up half-written. To prevent that, 
set `tempPrefix` to upload it under a temporary name and rename it once it is 
complete, or `doneFileName` to write an empty done file next to it once it is 
complete. It uses explicit TLS: it connects to the normal FTP port, usually 21, 
and then switches to TLS [...]
     required:
       - connectionHost
       - connectionPort
@@ -97,6 +97,16 @@ spec:
         description: If true, `directoryName`, and any subdirectory in the 
`CamelFileName` header, is created on the server when it does not exist.
         type: boolean
         default: true
+      tempPrefix:
+        title: Temporary Name Prefix
+        description: A prefix for the name a file is uploaded under. Once the 
upload is complete, the file is renamed to its real name, so a reader that 
skips the names with this prefix never picks up a half-written file. 
`ftps-source`, like other readers built with Camel, skips the names that start 
with a dot, so a prefix such as `.tmp-`, which uploads `orders.csv` as 
`.tmp-orders.csv`, works with it as it is. A prefix that ends with `/`, such as 
`.inprogress/`, uploads the file into th [...]
+        type: string
+        example: ".tmp-"
+      doneFileName:
+        title: Done File Name
+        description: The name of an empty file to write next to each file once 
the file is complete, so that a reader knows the file can be read. 
`$\{file:name}` stands for the name of the file and `$\{file:name.noext}` for 
the name without its extension, so `$\{file:name}.done` writes 
`orders.csv.done`, and `$\{file:name.noext}.ready` writes `orders.ready`. A 
fixed name, such as `ready`, is written again after each file. No other 
`$\{...}` is allowed, and with one the file is uploaded b [...]
+        type: string
+        example: "${file:name}.done"
   dataTypes:
     in:
       headers:
@@ -161,8 +171,10 @@ spec:
               host: "{{username}}@{{connectionHost}}"
               port: "{{connectionPort}}"
               directoryName: "{{directoryName}}"
+              doneFileName: "RAW({{?doneFileName}})"
               autoCreate: "{{autoCreate}}"
               binary: "{{binary}}"
               fileExist: "{{fileExist}}"
               passiveMode: "{{passiveMode}}"
               password: "RAW({{password}})"
+              tempPrefix: "RAW({{?tempPrefix}})"
diff --git a/kamelets/sftp-sink.kamelet.yaml b/kamelets/sftp-sink.kamelet.yaml
index a28eb427e..5f732ea54 100644
--- a/kamelets/sftp-sink.kamelet.yaml
+++ b/kamelets/sftp-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the message is unchanged. The `CamelFileNameProduced` header is 
set to the path of the file on the server.
 
-      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. Log in with `username` and either `password` or a private key. 
The key of the server must be in a known_hosts file, `knownHostsUri` or else 
`~/.ssh/known_hosts` of the user that runs the integration, or the connection 
fails. A file name that points outside `directoryName` fails the message.
+      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. A file is uploaded under its real name from the start, so a 
reader that polls the directory can pick it up half-written. To prevent that, 
set `tempPrefix` to upload it under a temporary name and rename it once it is 
complete, or `doneFileName` to write an empty done file next to it once it is 
complete. Log in with `username` and either `password` or a private key. The 
key of the server must be i [...]
     required:
       - connectionHost
       - connectionPort
@@ -130,6 +130,16 @@ spec:
         description: If true, `directoryName`, and any subdirectory in the 
`CamelFileName` header, is created on the server when it does not exist.
         type: boolean
         default: true
+      tempPrefix:
+        title: Temporary Name Prefix
+        description: A prefix for the name a file is uploaded under. Once the 
upload is complete, the file is renamed to its real name, so a reader that 
skips the names with this prefix never picks up a half-written file. 
`sftp-source`, like other readers built with Camel, skips the names that start 
with a dot, so a prefix such as `.tmp-`, which uploads `orders.csv` as 
`.tmp-orders.csv`, works with it as it is. A prefix that ends with `/`, such as 
`.inprogress/`, uploads the file into th [...]
+        type: string
+        example: ".tmp-"
+      doneFileName:
+        title: Done File Name
+        description: The name of an empty file to write next to each file once 
the file is complete, so that a reader knows the file can be read. 
`$\{file:name}` stands for the name of the file and `$\{file:name.noext}` for 
the name without its extension, so `$\{file:name}.done` writes 
`orders.csv.done`, and `$\{file:name.noext}.ready` writes `orders.ready`. A 
fixed name, such as `ready`, is written again after each file. No other 
`$\{...}` is allowed, and with one the file is uploaded b [...]
+        type: string
+        example: "${file:name}.done"
   dataTypes:
     in:
       headers:
@@ -194,6 +204,7 @@ spec:
               host: "{{connectionHost}}"
               port: "{{connectionPort}}"
               directoryName: "{{directoryName}}"
+              doneFileName: "RAW({{?doneFileName}})"
               autoCreate: "{{autoCreate}}"
               binary: "{{binary}}"
               fileExist: "{{fileExist}}"
@@ -204,5 +215,6 @@ spec:
               privateKeyPassphrase: "RAW({{?privateKeyPassphrase}})"
               privateKeyUri: "RAW({{?privateKeyUri}})"
               strictHostKeyChecking: "{{?strictHostKeyChecking}}"
+              tempPrefix: "RAW({{?tempPrefix}})"
               useUserKnownHostsFile: "{{?useUserKnownHostsFile}}"
               username: "RAW({{?username}})"
diff --git 
a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json 
b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
index e6fd303ff..94441a91e 100644
--- a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
+++ b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
@@ -785,7 +785,7 @@
     "supportLevel" : "Stable",
     "title" : "FTP Sink",
     "summary" : "Uploads each message as a file to a directory on an FTP 
server.",
-    "description" : "Uploads each message as a file to a directory on an FTP 
server.\n\nUse it to deliver exports, reports or data files to a partner or a 
legacy system that receives files over FTP. For an encrypted connection use 
`ftps-sink`, and for a server you reach with SSH use `sftp-sink`.\n\nInput: the 
body is the content of the file, as text, bytes or a stream. The name of the 
file comes from the `file` header, or from `ce-file` when `file` is not set; 
any directory in it is drop [...]
+    "description" : "Uploads each message as a file to a directory on an FTP 
server.\n\nUse it to deliver exports, reports or data files to a partner or a 
legacy system that receives files over FTP. For an encrypted connection use 
`ftps-sink`, and for a server you reach with SSH use `sftp-sink`.\n\nInput: the 
body is the content of the file, as text, bytes or a stream. The name of the 
file comes from the `file` header, or from `ce-file` when `file` is not set; 
any directory in it is drop [...]
     "group" : "FTP",
     "namespace" : "File",
     "provider" : "Apache Software Foundation"
@@ -805,7 +805,7 @@
     "supportLevel" : "Stable",
     "title" : "FTPS Sink",
     "summary" : "Uploads each message as a file to a directory on an FTPS 
server, which is FTP with TLS encryption.",
-    "description" : "Uploads each message as a file to a directory on an FTPS 
server, which is FTP with TLS encryption.\n\nUse it to deliver exports, reports 
or data files to a partner or a legacy system that receives files over FTPS. 
For a server without TLS use `ftp-sink`, and for a server you reach with SSH 
use `sftp-sink`.\n\nInput: the body is the content of the file, as text, bytes 
or a stream. The name of the file comes from the `file` header, or from 
`ce-file` when `file` is not  [...]
+    "description" : "Uploads each message as a file to a directory on an FTPS 
server, which is FTP with TLS encryption.\n\nUse it to deliver exports, reports 
or data files to a partner or a legacy system that receives files over FTPS. 
For a server without TLS use `ftp-sink`, and for a server you reach with SSH 
use `sftp-sink`.\n\nInput: the body is the content of the file, as text, bytes 
or a stream. The name of the file comes from the `file` header, or from 
`ce-file` when `file` is not  [...]
     "group" : "FTP",
     "namespace" : "File",
     "provider" : "Apache Software Foundation"
@@ -1985,7 +1985,7 @@
     "supportLevel" : "Stable",
     "title" : "SFTP Sink",
     "summary" : "Uploads each message as a file to a directory on an SFTP 
server, which transfers files over an encrypted SSH connection.",
-    "description" : "Uploads each message as a file to a directory on an SFTP 
server, which transfers files over an encrypted SSH connection.\n\nUse it to 
deliver exports, reports or data files to a server you reach with SSH, such as 
the SFTP drop box of a partner. For an FTP server use `ftp-sink` or 
`ftps-sink`.\n\nInput: the body is the content of the file, as text, bytes or a 
stream. The name of the file comes from the `file` header, or from `ce-file` 
when `file` is not set; any direc [...]
+    "description" : "Uploads each message as a file to a directory on an SFTP 
server, which transfers files over an encrypted SSH connection.\n\nUse it to 
deliver exports, reports or data files to a server you reach with SSH, such as 
the SFTP drop box of a partner. For an FTP server use `ftp-sink` or 
`ftps-sink`.\n\nInput: the body is the content of the file, as text, bytes or a 
stream. The name of the file comes from the `file` header, or from `ce-file` 
when `file` is not set; any direc [...]
     "group" : "FTP",
     "namespace" : "File",
     "provider" : "Apache Software Foundation"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/ftp-sink.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/ftp-sink.kamelet.yaml
index 843f487e4..26d78a507 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/ftp-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/ftp-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the message is unchanged. The `CamelFileNameProduced` header is 
set to the path of the file on the server.
 
-      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. The connection and the login are not encrypted. A file name 
that points outside `directoryName` fails the message. Files are sent in ASCII 
(text) mode unless `binary` is true.
+      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. A file is uploaded under its real name from the start, so a 
reader that polls the directory can pick it up half-written. To prevent that, 
set `tempPrefix` to upload it under a temporary name and rename it once it is 
complete, or `doneFileName` to write an empty done file next to it once it is 
complete. The connection and the login are not encrypted. A file name that 
points outside `directoryName [...]
     required:
       - connectionHost
       - connectionPort
@@ -97,6 +97,16 @@ spec:
         description: If true, `directoryName`, and any subdirectory in the 
`CamelFileName` header, is created on the server when it does not exist.
         type: boolean
         default: true
+      tempPrefix:
+        title: Temporary Name Prefix
+        description: A prefix for the name a file is uploaded under. Once the 
upload is complete, the file is renamed to its real name, so a reader that 
skips the names with this prefix never picks up a half-written file. 
`ftp-source`, like other readers built with Camel, skips the names that start 
with a dot, so a prefix such as `.tmp-`, which uploads `orders.csv` as 
`.tmp-orders.csv`, works with it as it is. A prefix that ends with `/`, such as 
`.inprogress/`, uploads the file into tha [...]
+        type: string
+        example: ".tmp-"
+      doneFileName:
+        title: Done File Name
+        description: The name of an empty file to write next to each file once 
the file is complete, so that a reader knows the file can be read. 
`$\{file:name}` stands for the name of the file and `$\{file:name.noext}` for 
the name without its extension, so `$\{file:name}.done` writes 
`orders.csv.done`, and `$\{file:name.noext}.ready` writes `orders.ready`. A 
fixed name, such as `ready`, is written again after each file. No other 
`$\{...}` is allowed, and with one the file is uploaded b [...]
+        type: string
+        example: "${file:name}.done"
   dataTypes:
     in:
       headers:
@@ -161,8 +171,10 @@ spec:
               host: "{{username}}@{{connectionHost}}"
               port: "{{connectionPort}}"
               directoryName: "{{directoryName}}"
+              doneFileName: "RAW({{?doneFileName}})"
               autoCreate: "{{autoCreate}}"
               binary: "{{binary}}"
               fileExist: "{{fileExist}}"
               passiveMode: "{{passiveMode}}"
               password: "RAW({{password}})"
+              tempPrefix: "RAW({{?tempPrefix}})"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/ftps-sink.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/ftps-sink.kamelet.yaml
index 06bde059e..1636b2980 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/ftps-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/ftps-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the message is unchanged. The `CamelFileNameProduced` header is 
set to the path of the file on the server.
 
-      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. It uses explicit TLS: it connects to the normal FTP port, 
usually 21, and then switches to TLS. A server that only accepts implicit TLS, 
usually on port 990, is not supported. A file name that points outside 
`directoryName` fails the message. Files are sent in ASCII (text) mode unless 
`binary` is true.
+      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. A file is uploaded under its real name from the start, so a 
reader that polls the directory can pick it up half-written. To prevent that, 
set `tempPrefix` to upload it under a temporary name and rename it once it is 
complete, or `doneFileName` to write an empty done file next to it once it is 
complete. It uses explicit TLS: it connects to the normal FTP port, usually 21, 
and then switches to TLS [...]
     required:
       - connectionHost
       - connectionPort
@@ -97,6 +97,16 @@ spec:
         description: If true, `directoryName`, and any subdirectory in the 
`CamelFileName` header, is created on the server when it does not exist.
         type: boolean
         default: true
+      tempPrefix:
+        title: Temporary Name Prefix
+        description: A prefix for the name a file is uploaded under. Once the 
upload is complete, the file is renamed to its real name, so a reader that 
skips the names with this prefix never picks up a half-written file. 
`ftps-source`, like other readers built with Camel, skips the names that start 
with a dot, so a prefix such as `.tmp-`, which uploads `orders.csv` as 
`.tmp-orders.csv`, works with it as it is. A prefix that ends with `/`, such as 
`.inprogress/`, uploads the file into th [...]
+        type: string
+        example: ".tmp-"
+      doneFileName:
+        title: Done File Name
+        description: The name of an empty file to write next to each file once 
the file is complete, so that a reader knows the file can be read. 
`$\{file:name}` stands for the name of the file and `$\{file:name.noext}` for 
the name without its extension, so `$\{file:name}.done` writes 
`orders.csv.done`, and `$\{file:name.noext}.ready` writes `orders.ready`. A 
fixed name, such as `ready`, is written again after each file. No other 
`$\{...}` is allowed, and with one the file is uploaded b [...]
+        type: string
+        example: "${file:name}.done"
   dataTypes:
     in:
       headers:
@@ -161,8 +171,10 @@ spec:
               host: "{{username}}@{{connectionHost}}"
               port: "{{connectionPort}}"
               directoryName: "{{directoryName}}"
+              doneFileName: "RAW({{?doneFileName}})"
               autoCreate: "{{autoCreate}}"
               binary: "{{binary}}"
               fileExist: "{{fileExist}}"
               passiveMode: "{{passiveMode}}"
               password: "RAW({{password}})"
+              tempPrefix: "RAW({{?tempPrefix}})"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/sftp-sink.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/sftp-sink.kamelet.yaml
index a28eb427e..5f732ea54 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/sftp-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/sftp-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the message is unchanged. The `CamelFileNameProduced` header is 
set to the path of the file on the server.
 
-      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. Log in with `username` and either `password` or a private key. 
The key of the server must be in a known_hosts file, `knownHostsUri` or else 
`~/.ssh/known_hosts` of the user that runs the integration, or the connection 
fails. A file name that points outside `directoryName` fails the message.
+      Good to know: a file with the same name is replaced, unless `fileExist` 
says otherwise. A file is uploaded under its real name from the start, so a 
reader that polls the directory can pick it up half-written. To prevent that, 
set `tempPrefix` to upload it under a temporary name and rename it once it is 
complete, or `doneFileName` to write an empty done file next to it once it is 
complete. Log in with `username` and either `password` or a private key. The 
key of the server must be i [...]
     required:
       - connectionHost
       - connectionPort
@@ -130,6 +130,16 @@ spec:
         description: If true, `directoryName`, and any subdirectory in the 
`CamelFileName` header, is created on the server when it does not exist.
         type: boolean
         default: true
+      tempPrefix:
+        title: Temporary Name Prefix
+        description: A prefix for the name a file is uploaded under. Once the 
upload is complete, the file is renamed to its real name, so a reader that 
skips the names with this prefix never picks up a half-written file. 
`sftp-source`, like other readers built with Camel, skips the names that start 
with a dot, so a prefix such as `.tmp-`, which uploads `orders.csv` as 
`.tmp-orders.csv`, works with it as it is. A prefix that ends with `/`, such as 
`.inprogress/`, uploads the file into th [...]
+        type: string
+        example: ".tmp-"
+      doneFileName:
+        title: Done File Name
+        description: The name of an empty file to write next to each file once 
the file is complete, so that a reader knows the file can be read. 
`$\{file:name}` stands for the name of the file and `$\{file:name.noext}` for 
the name without its extension, so `$\{file:name}.done` writes 
`orders.csv.done`, and `$\{file:name.noext}.ready` writes `orders.ready`. A 
fixed name, such as `ready`, is written again after each file. No other 
`$\{...}` is allowed, and with one the file is uploaded b [...]
+        type: string
+        example: "${file:name}.done"
   dataTypes:
     in:
       headers:
@@ -194,6 +204,7 @@ spec:
               host: "{{connectionHost}}"
               port: "{{connectionPort}}"
               directoryName: "{{directoryName}}"
+              doneFileName: "RAW({{?doneFileName}})"
               autoCreate: "{{autoCreate}}"
               binary: "{{binary}}"
               fileExist: "{{fileExist}}"
@@ -204,5 +215,6 @@ spec:
               privateKeyPassphrase: "RAW({{?privateKeyPassphrase}})"
               privateKeyUri: "RAW({{?privateKeyUri}})"
               strictHostKeyChecking: "{{?strictHostKeyChecking}}"
+              tempPrefix: "RAW({{?tempPrefix}})"
               useUserKnownHostsFile: "{{?useUserKnownHostsFile}}"
               username: "RAW({{?username}})"

Reply via email to