This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit d15d559848b0a210bf23405b70da88f554a5424b Author: Claus Ibsen <[email protected]> AuthorDate: Sat Apr 25 12:05:00 2020 +0200 CAMEL-14947: camel-sftp: check for existance of remote directory using ls is very slow. Polished the prev PR and rename the option to a better name. --- .../apache/camel/component/file/remote/sftp.json | 2 +- .../camel-ftp/src/main/docs/sftp-component.adoc | 2 +- .../component/file/remote/SftpConfiguration.java | 8 +-- .../endpoint/dsl/SftpEndpointBuilderFactory.java | 66 ++++++++++------------ 4 files changed, 36 insertions(+), 42 deletions(-) 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 386def2..156bb1e 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 @@ -78,7 +78,7 @@ "bulkRequests": { "kind": "parameter", "displayName": "Bulk Requests", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.SftpConfiguration", "configurationField": "configuration", "description": "Specifies how many requests may be outstanding at any one time. Increasing this value may slightly improve file transfer speed bu [...] "compression": { "kind": "parameter", "displayName": "Compression", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.file.remote.SftpConfiguration", "configurationField": "configuration", "description": "To use compression. Specify a level from 1 to 10. Important: You must manually add the needed JSCH zlib JAR to the classpath for compression support." }, "connectTimeout": { "kind": "parameter", "displayName": "Connect Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "10000", "configurationClass": "org.apache.camel.component.file.remote.SftpConfiguration", "configurationField": "configuration", "description": "Sets the connect timeout for waiting for a connection to be established Used by both FTPClient and JSCH" }, - "existDirCheckUsingLs": { "kind": "parameter", "displayName": "Exist Dir Check Using Ls", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.file.remote.SftpConfiguration", "configurationField": "configuration", "description": "Whether to check for existing directory using LS command instead of CD. By default CD is used wh [...] + "existDirCheckUsingLs": { "kind": "parameter", "displayName": "Exist Dir Check Using Ls", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.file.remote.SftpConfiguration", "configurationField": "configuration", "description": "Whether to check for existing directory using LS command or CD. By default LS is used which is s [...] "maximumReconnectAttempts": { "kind": "parameter", "displayName": "Maximum Reconnect Attempts", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "description": "Specifies the maximum reconnect attempts Camel performs when it tries to connect to the remote FTP server. Use 0 to disable this behavior." }, "proxy": { "kind": "parameter", "displayName": "Proxy", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.jcraft.jsch.Proxy", "deprecated": false, "secret": false, "description": "To use a custom configured com.jcraft.jsch.Proxy. This proxy is used to consume\/send messages from the target SFTP host." }, "reconnectDelay": { "kind": "parameter", "displayName": "Reconnect Delay", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "secret": false, "description": "Delay in millis Camel will wait before performing a reconnect attempt." }, diff --git a/components/camel-ftp/src/main/docs/sftp-component.adoc b/components/camel-ftp/src/main/docs/sftp-component.adoc index bb3c5d2..552a324 100644 --- a/components/camel-ftp/src/main/docs/sftp-component.adoc +++ b/components/camel-ftp/src/main/docs/sftp-component.adoc @@ -123,7 +123,7 @@ with the following path and query parameters: | *bulkRequests* (advanced) | Specifies how many requests may be outstanding at any one time. Increasing this value may slightly improve file transfer speed but will increase memory usage. | | Integer | *compression* (advanced) | To use compression. Specify a level from 1 to 10. Important: You must manually add the needed JSCH zlib JAR to the classpath for compression support. | | int | *connectTimeout* (advanced) | Sets the connect timeout for waiting for a connection to be established Used by both FTPClient and JSCH | 10000 | int -| *existDirCheckUsingLs* (advanced) | Whether to check for existing directory using LS command instead of CD. By default CD is used which is faster but has been reported to maybe cause a problem on windows systems and therefore this option can be enabled to use LS. The LS command is slower as it transfers the full directory listing over the wire, which can be slow if the remote FTP server has many files in the directory. | true | boolean +| *existDirCheckUsingLs* (advanced) | Whether to check for existing directory using LS command or CD. By default LS is used which is safer as otherwise Camel needs to change the directory back after checking. However LS has been reported to cause a problem on windows system in some situations and therefore you can disable this option to use CD. | true | boolean | *maximumReconnectAttempts* (advanced) | Specifies the maximum reconnect attempts Camel performs when it tries to connect to the remote FTP server. Use 0 to disable this behavior. | | int | *proxy* (advanced) | To use a custom configured com.jcraft.jsch.Proxy. This proxy is used to consume/send messages from the target SFTP host. | | Proxy | *reconnectDelay* (advanced) | Delay in millis Camel will wait before performing a reconnect attempt. | | long diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConfiguration.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConfiguration.java index 51523e1..5ac4487 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConfiguration.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConfiguration.java @@ -338,10 +338,10 @@ public class SftpConfiguration extends RemoteFileConfiguration { } /** - * Whether to check for existing directory using LS command instead of CD. - * By default CD is used which is faster but has been reported to maybe cause a problem on windows systems - * and therefore this option can be enabled to use LS. The LS command is slower as it transfers the full - * directory listing over the wire, which can be slow if the remote FTP server has many files in the directory. + * Whether to check for existing directory using LS command or CD. + * By default LS is used which is safer as otherwise Camel needs to change the directory + * back after checking. However LS has been reported to cause a problem on windows system in some situations + * and therefore you can disable this option to use CD. */ public void setExistDirCheckUsingLs(boolean existDirCheckUsingLs) { this.existDirCheckUsingLs = existDirCheckUsingLs; diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SftpEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SftpEndpointBuilderFactory.java index c473d8a..3e107fb 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SftpEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SftpEndpointBuilderFactory.java @@ -2703,12 +2703,11 @@ public interface SftpEndpointBuilderFactory { return this; } /** - * Whether to check for existing directory using LS command instead of - * CD. By default CD is used which is faster but has been reported to - * maybe cause a problem on windows systems and therefore this option - * can be enabled to use LS. The LS command is slower as it transfers - * the full directory listing over the wire, which can be slow if the - * remote FTP server has many files in the directory. + * Whether to check for existing directory using LS command or CD. By + * default LS is used which is safer as otherwise Camel needs to change + * the directory back after checking. However LS has been reported to + * cause a problem on windows system in some situations and therefore + * you can disable this option to use CD. * * The option is a: <code>boolean</code> type. * @@ -2721,12 +2720,11 @@ public interface SftpEndpointBuilderFactory { return this; } /** - * Whether to check for existing directory using LS command instead of - * CD. By default CD is used which is faster but has been reported to - * maybe cause a problem on windows systems and therefore this option - * can be enabled to use LS. The LS command is slower as it transfers - * the full directory listing over the wire, which can be slow if the - * remote FTP server has many files in the directory. + * Whether to check for existing directory using LS command or CD. By + * default LS is used which is safer as otherwise Camel needs to change + * the directory back after checking. However LS has been reported to + * cause a problem on windows system in some situations and therefore + * you can disable this option to use CD. * * The option will be converted to a <code>boolean</code> type. * @@ -4185,12 +4183,11 @@ public interface SftpEndpointBuilderFactory { return this; } /** - * Whether to check for existing directory using LS command instead of - * CD. By default CD is used which is faster but has been reported to - * maybe cause a problem on windows systems and therefore this option - * can be enabled to use LS. The LS command is slower as it transfers - * the full directory listing over the wire, which can be slow if the - * remote FTP server has many files in the directory. + * Whether to check for existing directory using LS command or CD. By + * default LS is used which is safer as otherwise Camel needs to change + * the directory back after checking. However LS has been reported to + * cause a problem on windows system in some situations and therefore + * you can disable this option to use CD. * * The option is a: <code>boolean</code> type. * @@ -4203,12 +4200,11 @@ public interface SftpEndpointBuilderFactory { return this; } /** - * Whether to check for existing directory using LS command instead of - * CD. By default CD is used which is faster but has been reported to - * maybe cause a problem on windows systems and therefore this option - * can be enabled to use LS. The LS command is slower as it transfers - * the full directory listing over the wire, which can be slow if the - * remote FTP server has many files in the directory. + * Whether to check for existing directory using LS command or CD. By + * default LS is used which is safer as otherwise Camel needs to change + * the directory back after checking. However LS has been reported to + * cause a problem on windows system in some situations and therefore + * you can disable this option to use CD. * * The option will be converted to a <code>boolean</code> type. * @@ -5179,12 +5175,11 @@ public interface SftpEndpointBuilderFactory { return this; } /** - * Whether to check for existing directory using LS command instead of - * CD. By default CD is used which is faster but has been reported to - * maybe cause a problem on windows systems and therefore this option - * can be enabled to use LS. The LS command is slower as it transfers - * the full directory listing over the wire, which can be slow if the - * remote FTP server has many files in the directory. + * Whether to check for existing directory using LS command or CD. By + * default LS is used which is safer as otherwise Camel needs to change + * the directory back after checking. However LS has been reported to + * cause a problem on windows system in some situations and therefore + * you can disable this option to use CD. * * The option is a: <code>boolean</code> type. * @@ -5197,12 +5192,11 @@ public interface SftpEndpointBuilderFactory { return this; } /** - * Whether to check for existing directory using LS command instead of - * CD. By default CD is used which is faster but has been reported to - * maybe cause a problem on windows systems and therefore this option - * can be enabled to use LS. The LS command is slower as it transfers - * the full directory listing over the wire, which can be slow if the - * remote FTP server has many files in the directory. + * Whether to check for existing directory using LS command or CD. By + * default LS is used which is safer as otherwise Camel needs to change + * the directory back after checking. However LS has been reported to + * cause a problem on windows system in some situations and therefore + * you can disable this option to use CD. * * The option will be converted to a <code>boolean</code> type. *
