Apache Camel 如何支持使用 SFTP 传输 ASCII 模式文件?
How does Apache Camel support ASCII mode file transfer with SFTP?
Apache Camel SFTP 实现使用 JSch。但是JSCH只支持二进制文件传输,据我了解link:
那么Camel SFTP是如何支持binary
作为URI参数的呢?
https://camel.apache.org/components/latest/sftp-component.html
我的理解有误吗?
文档很可能是假的。
FtpEndpointConfigurer
和 SftpEndpointConfigurer
确实分别将 binary
参数传播到 FtpConfiguration.setBinary
和 SftpConfiguration.setBinary
。所以从这个意义上说,都支持那个参数。
但是当 FtpOperations
查询 FtpConfiguration.isBinary
并相应地设置 FtpClient
模式时:
client.setFileType(configuration.isBinary() ? FTP.BINARY_FILE_TYPE : FTP.ASCII_FILE_TYPE);
... SftpConfiguration.isBinary
永远不会被调用。所以永远不会使用配置的值。
Apache Camel SFTP 实现使用 JSch。但是JSCH只支持二进制文件传输,据我了解link:
那么Camel SFTP是如何支持binary
作为URI参数的呢?
https://camel.apache.org/components/latest/sftp-component.html
我的理解有误吗?
文档很可能是假的。
FtpEndpointConfigurer
和SftpEndpointConfigurer
确实分别将binary
参数传播到FtpConfiguration.setBinary
和SftpConfiguration.setBinary
。所以从这个意义上说,都支持那个参数。但是当
FtpOperations
查询FtpConfiguration.isBinary
并相应地设置FtpClient
模式时:client.setFileType(configuration.isBinary() ? FTP.BINARY_FILE_TYPE : FTP.ASCII_FILE_TYPE);
...
SftpConfiguration.isBinary
永远不会被调用。所以永远不会使用配置的值。