The SFTP component provides access to remote file systems through FTP and SFTP protocols.
URI Syntax: sftp:host:port/directoryName
Path parameters
Name | Description | Default | Type |
|---|---|---|---|
host (common) | (required) Hostname of the FTP server. | — | String |
port (common) | Port of the FTP server. | — | int |
directoryName (common) | Initial directory. | — | String |
Query parameters
Name | Description | Default | Type |
|---|---|---|---|
username (security) | Username for SFTP server authentication. | — | String |
password(security) | Password for SFTP server authentication. | — | String |
fileName(common) | Used to dynamically set the file name as an expression. In the consumer, it serves as a name filter; in the producer, to evaluate the filename to write. | — | String |
passiveMode (common) | Defines that the SFTP connection should use passive mode. | false | boolean |
includeExt (filter) | Used to include files matching the file extension name (case-insensitive). For example, to include .txt files, use includeExt=txt. Multiple extensions can be separated by commas; for example, to include .txt and .xml files, use includeExt=txt,xml. | — | String |
delay (scheduler) | Milliseconds before the next poll. | 500 | long |
The flow reads .txt files from a specified SFTP server every 10 seconds, using a username and password for authentication.
Then, the content is displayed in a log.
NOTEThe component does not delete files that have already been processed, as the server operates in read-only mode.

NOTE
The connection configured in the example does not validate the SFTP server's identity, which means it would not detect potential security issues.
For secure validation, Apache Camel allows using a
known_hostsfile. To do this, you need to:
- Include the
known_hostsfile as a resource in the integration.- Configure the
knownHostsFileparameter pointing to the file.- Enable the
strictHostKeyCheckingparameter.Read more about Resources files.
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more