This is an automated email from the ASF dual-hosted git repository. nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers in repository https://gitbox.apache.org/repos/asf/camel.git
commit 9f58ec6dc1d9cb1db056e65064321264ac885be7 Author: Nicolas Filotto <[email protected]> AuthorDate: Mon Mar 21 15:39:04 2022 +0100 CAMEL-17792: Add doc about the message headers of camel-ftp --- .../apache/camel/component/file/remote/ftp.json | 14 +++++++- .../apache/camel/component/file/remote/ftps.json | 14 +++++++- .../apache/camel/component/file/remote/sftp.json | 14 +++++++- .../camel-ftp/src/main/docs/ftp-component.adoc | 41 ++-------------------- .../camel-ftp/src/main/docs/ftps-component.adoc | 3 ++ .../camel-ftp/src/main/docs/sftp-component.adoc | 3 ++ .../camel/component/file/remote/FtpConstants.java | 27 ++++++++++++++ .../camel/component/file/remote/FtpConsumer.java | 4 +-- .../remote/FtpDefaultMoveExistingFileStrategy.java | 6 ++-- .../camel/component/file/remote/FtpEndpoint.java | 2 +- .../camel/component/file/remote/FtpOperations.java | 6 ++-- .../camel/component/file/remote/FtpsEndpoint.java | 2 +- .../camel/component/file/remote/RemoteFile.java | 2 +- .../component/file/remote/RemoteFileProducer.java | 4 +-- .../camel/component/file/remote/SftpConsumer.java | 4 +-- .../SftpDefaultMoveExistingFileStrategy.java | 6 ++-- .../camel/component/file/remote/SftpEndpoint.java | 2 +- .../component/file/remote/SftpOperations.java | 6 ++-- 18 files changed, 97 insertions(+), 63 deletions(-) diff --git a/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/ftp.json b/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/ftp.json index 9ca26fd..ad47396 100644 --- a/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/ftp.json +++ b/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/ftp.json @@ -28,6 +28,18 @@ "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...] "autowiredEnabled": { "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 type, which t [...] }, + "headers": { + "CamelFileLength": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A `long` value containing the file size." }, + "CamelFileLastModified": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A `Long` value containing the last modified timestamp of the file." }, + "CamelFileName": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Specifies the output file name (relative to the endpoint directory) to\nbe used for the output message when sending to the endpoint. If this is\nnot present and no expression either, then a generated message ID is\nused as the filename instead." }, + "CamelFileNameOnly": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Only the file name (the name with no leading paths)." }, + "CamelFileParent": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The parent path." }, + "CamelRemoteFileInputStream": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "java.io.InputStream", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The remote file input stream." }, + "CamelFileLocalWorkPath": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Path to the local work file, if local work directory is used." }, + "CamelFtpReplyCode": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The FTP client reply code" }, + "CamelFtpReplyString": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The FTP client reply string" }, + "CamelFileHost": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The remote hostname." } + }, "properties": { "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.FtpConfiguration", "configurationField": "configuration", "description": "Hostname of the FTP server" }, "port": { "kind": "path", "displayName": "Port", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.FtpConfiguration", "configurationField": "configuration", "description": "Port of the FTP server" }, @@ -75,7 +87,7 @@ "chmod": { "kind": "parameter", "displayName": "Chmod", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.FtpConfiguration", "configurationField": "configuration", "description": "Allows you to set chmod on the stored file. For example chmod=640." }, "disconnectOnBatchComplete": { "kind": "parameter", "displayName": "Disconnect On Batch Complete", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether or not to disconnect from remote FTP server right after a Batch upload is complete. disconnectOnBatchComplete will only disconnect the current connection to the [...] "eagerDeleteTargetFile": { "kind": "parameter", "displayName": "Eager Delete Target File", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether or not to eagerly delete any existing target file. This option only applies when you use fileExists=Override and the tempFileName option as well. You can use this to disa [...] - "keepLastModified": { "kind": "parameter", "displayName": "Keep Last Modified", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Will keep the last modified timestamp from the source file (if any). Will use the Exchange.FILE_LAST_MODIFIED header to located the timestamp. This header can contain either a java.util.Da [...] + "keepLastModified": { "kind": "parameter", "displayName": "Keep Last Modified", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Will keep the last modified timestamp from the source file (if any). Will use the FileConstants.FILE_LAST_MODIFIED header to located the timestamp. This header can contain either a java.ut [...] "moveExistingFileStrategy": { "kind": "parameter", "displayName": "Move Existing File Strategy", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.file.strategy.FileMoveExistingStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "Strategy (Custom Strategy) used to move file with special naming token to use when fileExist=Move is configured. By default, there is an [...] "sendNoop": { "kind": "parameter", "displayName": "Send Noop", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.file.remote.FtpConfiguration", "configurationField": "configuration", "description": "Whether to send a noop command as a pre-write check before uploading files to the FTP [...] "activePortRange": { "kind": "parameter", "displayName": "Active Port Range", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.FtpConfiguration", "configurationField": "configuration", "description": "Set the client side port range in active mode. The syntax is: minPort-maxPort Both port numbers are inclu [...] diff --git a/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/ftps.json b/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/ftps.json index 5341b68..df82c74 100644 --- a/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/ftps.json +++ b/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/ftps.json @@ -29,6 +29,18 @@ "autowiredEnabled": { "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 type, which t [...] "useGlobalSslContextParameters": { "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." } }, + "headers": { + "CamelFileLength": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A `long` value containing the file size." }, + "CamelFileLastModified": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A `Long` value containing the last modified timestamp of the file." }, + "CamelFileName": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Specifies the output file name (relative to the endpoint directory) to\nbe used for the output message when sending to the endpoint. If this is\nnot present and no expression either, then a generated message ID is\nused as the filename instead." }, + "CamelFileNameOnly": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Only the file name (the name with no leading paths)." }, + "CamelFileParent": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The parent path." }, + "CamelRemoteFileInputStream": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "java.io.InputStream", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The remote file input stream." }, + "CamelFileLocalWorkPath": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Path to the local work file, if local work directory is used." }, + "CamelFtpReplyCode": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The FTP client reply code" }, + "CamelFtpReplyString": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The FTP client reply string" }, + "CamelFileHost": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The remote hostname." } + }, "properties": { "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.FtpsConfiguration", "configurationField": "configuration", "description": "Hostname of the FTP server" }, "port": { "kind": "path", "displayName": "Port", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.FtpsConfiguration", "configurationField": "configuration", "description": "Port of the FTP server" }, @@ -76,7 +88,7 @@ "chmod": { "kind": "parameter", "displayName": "Chmod", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.FtpsConfiguration", "configurationField": "configuration", "description": "Allows you to set chmod on the stored file. For example chmod=640." }, "disconnectOnBatchComplete": { "kind": "parameter", "displayName": "Disconnect On Batch Complete", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether or not to disconnect from remote FTP server right after a Batch upload is complete. disconnectOnBatchComplete will only disconnect the current connection to the [...] "eagerDeleteTargetFile": { "kind": "parameter", "displayName": "Eager Delete Target File", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether or not to eagerly delete any existing target file. This option only applies when you use fileExists=Override and the tempFileName option as well. You can use this to disa [...] - "keepLastModified": { "kind": "parameter", "displayName": "Keep Last Modified", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Will keep the last modified timestamp from the source file (if any). Will use the Exchange.FILE_LAST_MODIFIED header to located the timestamp. This header can contain either a java.util.Da [...] + "keepLastModified": { "kind": "parameter", "displayName": "Keep Last Modified", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Will keep the last modified timestamp from the source file (if any). Will use the FileConstants.FILE_LAST_MODIFIED header to located the timestamp. This header can contain either a java.ut [...] "moveExistingFileStrategy": { "kind": "parameter", "displayName": "Move Existing File Strategy", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.file.strategy.FileMoveExistingStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "Strategy (Custom Strategy) used to move file with special naming token to use when fileExist=Move is configured. By default, there is an [...] "sendNoop": { "kind": "parameter", "displayName": "Send Noop", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.file.remote.FtpsConfiguration", "configurationField": "configuration", "description": "Whether to send a noop command as a pre-write check before uploading files to the FTP [...] "activePortRange": { "kind": "parameter", "displayName": "Active Port Range", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.FtpsConfiguration", "configurationField": "configuration", "description": "Set the client side port range in active mode. The syntax is: minPort-maxPort Both port numbers are incl [...] diff --git a/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/sftp.json b/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/sftp.json index c1c3cfe..369601c 100644 --- a/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/sftp.json +++ b/components/camel-ftp/src/generated/resources/org/apache/camel/component/file/remote/sftp.json @@ -27,6 +27,18 @@ "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...] "autowiredEnabled": { "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 type, which t [...] }, + "headers": { + "CamelFileLength": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A `long` value containing the file size." }, + "CamelFileLastModified": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A `Long` value containing the last modified timestamp of the file." }, + "CamelFileName": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Specifies the output file name (relative to the endpoint directory) to\nbe used for the output message when sending to the endpoint. If this is\nnot present and no expression either, then a generated message ID is\nused as the filename instead." }, + "CamelFileNameOnly": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Only the file name (the name with no leading paths)." }, + "CamelFileParent": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The parent path." }, + "CamelRemoteFileInputStream": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "java.io.InputStream", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The remote file input stream." }, + "CamelFileLocalWorkPath": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Path to the local work file, if local work directory is used." }, + "CamelFtpReplyCode": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The FTP client reply code" }, + "CamelFtpReplyString": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The FTP client reply string" }, + "CamelFileHost": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The remote hostname." } + }, "properties": { "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.SftpConfiguration", "configurationField": "configuration", "description": "Hostname of the FTP server" }, "port": { "kind": "path", "displayName": "Port", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.SftpConfiguration", "configurationField": "configuration", "description": "Port of the FTP server" }, @@ -71,7 +83,7 @@ "chmodDirectory": { "kind": "parameter", "displayName": "Chmod Directory", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.SftpConfiguration", "configurationField": "configuration", "description": "Allows you to set chmod during path creation. For example chmod=640." }, "disconnectOnBatchComplete": { "kind": "parameter", "displayName": "Disconnect On Batch Complete", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether or not to disconnect from remote FTP server right after a Batch upload is complete. disconnectOnBatchComplete will only disconnect the current connection to the [...] "eagerDeleteTargetFile": { "kind": "parameter", "displayName": "Eager Delete Target File", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether or not to eagerly delete any existing target file. This option only applies when you use fileExists=Override and the tempFileName option as well. You can use this to disa [...] - "keepLastModified": { "kind": "parameter", "displayName": "Keep Last Modified", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Will keep the last modified timestamp from the source file (if any). Will use the Exchange.FILE_LAST_MODIFIED header to located the timestamp. This header can contain either a java.util.Da [...] + "keepLastModified": { "kind": "parameter", "displayName": "Keep Last Modified", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Will keep the last modified timestamp from the source file (if any). Will use the FileConstants.FILE_LAST_MODIFIED header to located the timestamp. This header can contain either a java.ut [...] "moveExistingFileStrategy": { "kind": "parameter", "displayName": "Move Existing File Strategy", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.file.strategy.FileMoveExistingStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "Strategy (Custom Strategy) used to move file with special naming token to use when fileExist=Move is configured. By default, there is an [...] "sendNoop": { "kind": "parameter", "displayName": "Send Noop", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.file.remote.SftpConfiguration", "configurationField": "configuration", "description": "Whether to send a noop command as a pre-write check before uploading files to the FTP [...] "autoCreate": { "kind": "parameter", "displayName": "Auto Create", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Automatically create missing directories in the file's pathname. For the file consumer, that means creating the starting directory. For the file producer, it means the directory the files should be written to." }, diff --git a/components/camel-ftp/src/main/docs/ftp-component.adoc b/components/camel-ftp/src/main/docs/ftp-component.adoc index 0a482f6..ec38d77 100644 --- a/components/camel-ftp/src/main/docs/ftp-component.adoc +++ b/components/camel-ftp/src/main/docs/ftp-component.adoc @@ -84,7 +84,9 @@ include::partial$component-endpoint-options.adoc[] // endpoint options: START // endpoint options: END - +// component headers: START +include::partial$component-endpoint-headers.adoc[] +// component headers: END == FTPS component default trust store @@ -202,43 +204,6 @@ restricted to the FTP_ROOT folder. That prevents you from moving files outside the FTP area. If you want to move files to another area you can use soft links and move files into a soft linked folder. -== Message Headers - -The following message headers can be used to affect the behavior of the -component - -[width="100%",cols="50%,50%",options="header",] -|======================================================================= -|Header |Description - -|`CamelFileName` |Specifies the output file name (relative to the endpoint directory) to -be used for the output message when sending to the endpoint. If this is -not present and no expression either, then a generated message ID is -used as the filename instead. - -|`CamelFileNameProduced` |The actual filepath (path + name) for the output file that was written. -This header is set by Camel and its purpose is providing end-users the -name of the file that was written. - -|`CamelFileNameConsumed` |The file name of the file consumed - -|`CamelFileHost` |The remote hostname. - -|`CamelFileLocalWorkPath` |Path to the local work file, if local work directory is used. -|======================================================================= - -In addition the FTP/FTPS consumer and producer will enrich the Camel -`Message` with the following headers - -[width="100%",cols="50%,50%",options="header",] -|======================================================================= -|Header |Description - -|`CamelFtpReplyCode` |The FTP client reply code (the type is a integer) - -|`CamelFtpReplyString` |The FTP client reply string -|======================================================================= - == Exchange Properties Camel sets the following exchange properties diff --git a/components/camel-ftp/src/main/docs/ftps-component.adoc b/components/camel-ftp/src/main/docs/ftps-component.adoc index 6b0b3d5..85c8b84 100644 --- a/components/camel-ftp/src/main/docs/ftps-component.adoc +++ b/components/camel-ftp/src/main/docs/ftps-component.adoc @@ -42,6 +42,9 @@ include::partial$component-endpoint-options.adoc[] // endpoint options: START // endpoint options: END +// component headers: START +include::partial$component-endpoint-headers.adoc[] +// component headers: END == More Information diff --git a/components/camel-ftp/src/main/docs/sftp-component.adoc b/components/camel-ftp/src/main/docs/sftp-component.adoc index 6d41b7e..a5953a8 100644 --- a/components/camel-ftp/src/main/docs/sftp-component.adoc +++ b/components/camel-ftp/src/main/docs/sftp-component.adoc @@ -41,6 +41,9 @@ include::partial$component-endpoint-options.adoc[] // endpoint options: START // endpoint options: END +// component headers: START +include::partial$component-endpoint-headers.adoc[] +// component headers: END == More Information diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConstants.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConstants.java index 4c75889..9d568c8 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConstants.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConstants.java @@ -16,13 +16,40 @@ */ package org.apache.camel.component.file.remote; +import org.apache.camel.Exchange; +import org.apache.camel.spi.Metadata; + /** * Constants */ public final class FtpConstants { + @Metadata(label = "consumer", description = "A `long` value containing the file size.", javaType = "long") + public static final String FILE_LENGTH = Exchange.FILE_LENGTH; + @Metadata(label = "consumer", description = "A `Long` value containing the last modified timestamp of the file.", + javaType = "long") + public static final String FILE_LAST_MODIFIED = Exchange.FILE_LAST_MODIFIED; + @Metadata(description = "Specifies the output file name (relative to the endpoint directory) to\n" + + "be used for the output message when sending to the endpoint. If this is\n" + + "not present and no expression either, then a generated message ID is\n" + + "used as the filename instead.", + javaType = "String") + public static final String FILE_NAME = Exchange.FILE_NAME; + @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 = "The parent path.", javaType = "String") + public static final String FILE_PARENT = Exchange.FILE_PARENT; + @Metadata(description = "The remote file input stream.", javaType = "java.io.InputStream") + public static final String REMOTE_FILE_INPUT_STREAM = RemoteFileComponent.REMOTE_FILE_INPUT_STREAM; + @Metadata(description = "Path to the local work file, if local work directory is used.", javaType = "String") + public static final String FILE_LOCAL_WORK_PATH = Exchange.FILE_LOCAL_WORK_PATH; + + @Metadata(description = "The FTP client reply code", javaType = "int") public static final String FTP_REPLY_CODE = "CamelFtpReplyCode"; + @Metadata(description = "The FTP client reply string", javaType = "String") public static final String FTP_REPLY_STRING = "CamelFtpReplyString"; + @Metadata(description = "The remote hostname.", javaType = "String") + public static final String FILE_HOST = "CamelFileHost"; private FtpConstants() { } diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java index 1066539..1b51b21 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java @@ -321,10 +321,10 @@ public class FtpConsumer extends RemoteFileConsumer<FTPFile> { file.setFileLength(length); file.setLastModified(modified); if (length >= 0) { - message.setHeader(Exchange.FILE_LENGTH, length); + message.setHeader(FtpConstants.FILE_LENGTH, length); } if (modified >= 0) { - message.setHeader(Exchange.FILE_LAST_MODIFIED, modified); + message.setHeader(FtpConstants.FILE_LAST_MODIFIED, modified); } } diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpDefaultMoveExistingFileStrategy.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpDefaultMoveExistingFileStrategy.java index 48225bc..31df2a8 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpDefaultMoveExistingFileStrategy.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpDefaultMoveExistingFileStrategy.java @@ -51,9 +51,9 @@ public class FtpDefaultMoveExistingFileStrategy implements FileMoveExistingStrat //any leading separator String parent = FileUtil.stripLeadingSeparator(FileUtil.onlyPath(fileName)); String onlyName = FileUtil.stripPath(fileName); - dummy.getIn().setHeader(Exchange.FILE_NAME, fileName); - dummy.getIn().setHeader(Exchange.FILE_NAME_ONLY, onlyName); - dummy.getIn().setHeader(Exchange.FILE_PARENT, parent); + dummy.getIn().setHeader(FtpConstants.FILE_NAME, fileName); + dummy.getIn().setHeader(FtpConstants.FILE_NAME_ONLY, onlyName); + dummy.getIn().setHeader(FtpConstants.FILE_PARENT, parent); String to = endpoint.getMoveExisting().evaluate(dummy, String.class); // we only support relative paths for the ftp component, so strip any diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java index 58d878e..0220456 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java @@ -48,7 +48,7 @@ import org.slf4j.LoggerFactory; */ @UriEndpoint(firstVersion = "1.1.0", scheme = "ftp", extendsScheme = "file", title = "FTP", syntax = "ftp:host:port/directoryName", alternativeSyntax = "ftp:username:password@host:port/directoryName", - category = { Category.FILE }) + category = { Category.FILE }, headersClass = FtpConstants.class) @Metadata(excludeProperties = "appendChars,readLockIdempotentReleaseAsync,readLockIdempotentReleaseAsyncPoolSize," + "readLockIdempotentReleaseDelay,readLockIdempotentReleaseExecutorService," + "directoryMustExist,extendedAttributes,probeContentType,startingDirectoryMustExist," diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java index b1da0ec..965bf33 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java @@ -434,7 +434,7 @@ public class FtpOperations implements RemoteFileOperations<FTPFile> { @Override public void releaseRetrievedFileResources(Exchange exchange) throws GenericFileOperationFailedException { - InputStream is = exchange.getIn().getHeader(RemoteFileComponent.REMOTE_FILE_INPUT_STREAM, InputStream.class); + InputStream is = exchange.getIn().getHeader(FtpConstants.REMOTE_FILE_INPUT_STREAM, InputStream.class); if (is != null) { try { @@ -480,7 +480,7 @@ public class FtpOperations implements RemoteFileOperations<FTPFile> { if (endpoint.getConfiguration().isStreamDownload()) { InputStream is = client.retrieveFileStream(remoteName); target.setBody(is); - exchange.getIn().setHeader(RemoteFileComponent.REMOTE_FILE_INPUT_STREAM, is); + exchange.getIn().setHeader(FtpConstants.REMOTE_FILE_INPUT_STREAM, is); result = true; } else { // read the entire file into memory in the byte array @@ -568,7 +568,7 @@ public class FtpOperations implements RemoteFileOperations<FTPFile> { os = new FileOutputStream(temp, append); // set header with the path to the local work file - exchange.getIn().setHeader(Exchange.FILE_LOCAL_WORK_PATH, local.getPath()); + exchange.getIn().setHeader(FtpConstants.FILE_LOCAL_WORK_PATH, local.getPath()); } catch (Exception e) { throw new GenericFileOperationFailedException("Cannot create new local work file: " + local); diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java index fac83e0..801051e 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java @@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory; */ @UriEndpoint(firstVersion = "2.2.0", scheme = "ftps", extendsScheme = "file", title = "FTPS", syntax = "ftps:host:port/directoryName", alternativeSyntax = "ftps:username:password@host:port/directoryName", - label = "file") + label = "file", headersClass = FtpConstants.class) @Metadata(excludeProperties = "appendChars,readLockIdempotentReleaseAsync,readLockIdempotentReleaseAsyncPoolSize," + "readLockIdempotentReleaseDelay,readLockIdempotentReleaseExecutorService," + "directoryMustExist,extendedAttributes,probeContentType,startingDirectoryMustExist," diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFile.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFile.java index 6fa94a6..e2c5391 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFile.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFile.java @@ -39,7 +39,7 @@ public class RemoteFile<T> extends GenericFile<T> implements Cloneable { // in other file based components, false may be passed // as the second argument. super.populateHeaders(message, false); - message.setHeader("CamelFileHost", getHostname()); + message.setHeader(FtpConstants.FILE_HOST, getHostname()); } } diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java index 78e1323..29c6269 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java @@ -52,7 +52,7 @@ public class RemoteFileProducer<T> extends GenericFileProducer<T> { @Override public void process(Exchange exchange) throws Exception { // store any existing file header which we want to keep and propagate - final String existing = exchange.getIn().getHeader(Exchange.FILE_NAME, String.class); + final String existing = exchange.getIn().getHeader(FtpConstants.FILE_NAME, String.class); // create the target file name String target = createFileName(exchange); @@ -64,7 +64,7 @@ public class RemoteFileProducer<T> extends GenericFileProducer<T> { // (by design) exchange.getIn().removeHeader(Exchange.OVERRULE_FILE_NAME); // and restore existing file name - exchange.getIn().setHeader(Exchange.FILE_NAME, existing); + exchange.getIn().setHeader(FtpConstants.FILE_NAME, existing); } } diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java index 55dd15b..67b438f 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java @@ -300,10 +300,10 @@ public class SftpConsumer extends RemoteFileConsumer<SftpRemoteFile> { file.setFileLength(length); file.setLastModified(modified); if (length >= 0) { - message.setHeader(Exchange.FILE_LENGTH, length); + message.setHeader(FtpConstants.FILE_LENGTH, length); } if (modified >= 0) { - message.setHeader(Exchange.FILE_LAST_MODIFIED, modified); + message.setHeader(FtpConstants.FILE_LAST_MODIFIED, modified); } } } diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpDefaultMoveExistingFileStrategy.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpDefaultMoveExistingFileStrategy.java index f139fbb..7c5623e 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpDefaultMoveExistingFileStrategy.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpDefaultMoveExistingFileStrategy.java @@ -48,9 +48,9 @@ public class SftpDefaultMoveExistingFileStrategy implements FileMoveExistingStra //any leading separator String parent = FileUtil.stripLeadingSeparator(FileUtil.onlyPath(fileName)); String onlyName = FileUtil.stripPath(fileName); - dummy.getIn().setHeader(Exchange.FILE_NAME, fileName); - dummy.getIn().setHeader(Exchange.FILE_NAME_ONLY, onlyName); - dummy.getIn().setHeader(Exchange.FILE_PARENT, parent); + dummy.getIn().setHeader(FtpConstants.FILE_NAME, fileName); + dummy.getIn().setHeader(FtpConstants.FILE_NAME_ONLY, onlyName); + dummy.getIn().setHeader(FtpConstants.FILE_PARENT, parent); String to = endpoint.getMoveExisting().evaluate(dummy, String.class); diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java index 5a26d75..a1e6608 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java @@ -31,7 +31,7 @@ import org.apache.camel.spi.UriParam; * Upload and download files to/from SFTP servers. */ @UriEndpoint(firstVersion = "1.1.0", scheme = "sftp", extendsScheme = "file", title = "SFTP", - syntax = "sftp:host:port/directoryName", label = "file") + syntax = "sftp:host:port/directoryName", label = "file", headersClass = FtpConstants.class) @Metadata(excludeProperties = "appendChars,bufferSize,siteCommand," + "directoryMustExist,extendedAttributes,probeContentType,startingDirectoryMustExist," + "startingDirectoryMustHaveAccess,forceWrites,copyAndDeleteOnRenameFail," diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java index 26fd3ad..0d33723 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java @@ -760,7 +760,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> { @Override public synchronized void releaseRetrievedFileResources(Exchange exchange) throws GenericFileOperationFailedException { - InputStream is = exchange.getIn().getHeader(RemoteFileComponent.REMOTE_FILE_INPUT_STREAM, InputStream.class); + InputStream is = exchange.getIn().getHeader(FtpConstants.REMOTE_FILE_INPUT_STREAM, InputStream.class); if (is != null) { try { @@ -801,7 +801,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> { if (endpoint.getConfiguration().isStreamDownload()) { target.setBody(is); - exchange.getIn().setHeader(RemoteFileComponent.REMOTE_FILE_INPUT_STREAM, is); + exchange.getIn().setHeader(FtpConstants.REMOTE_FILE_INPUT_STREAM, is); } else { // read the entire file into memory in the byte array ByteArrayOutputStream bos = new ByteArrayOutputStream(); @@ -868,7 +868,7 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> { os = new FileOutputStream(temp); // set header with the path to the local work file - exchange.getIn().setHeader(Exchange.FILE_LOCAL_WORK_PATH, local.getPath()); + exchange.getIn().setHeader(FtpConstants.FILE_LOCAL_WORK_PATH, local.getPath()); } catch (Exception e) { throw new GenericFileOperationFailedException("Cannot create new local work file: " + local); }
