Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.22.0
-
None
-
Unknown
Description
Simple SFTP-to-File integrations with charset conversion like:
from("sftp://sample@localhost:2222/in?password=password&delete=true&charset=ISO-8859-1") .to("file:/tmp/samples-camel/SftpToFileTest/out?charset=UTF-8");
fails to output a file in /tmp/samples-camel/SftpToFileTest/out/ correctly. Depending on the combinations, it sometimes converts the charset wrongly and sometimes it simply doesn't output a file to the target dir.
The root cause is that SftpOperations puts ByteArrayOutputStream instead of byte[] or InputStream to the exchange file body when retrieving a file:
https://github.com/apache/camel/blob/camel-2.22.0/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java#L718-L720
which then results in no converter from OutputStream to java.io.Reader being found in GenericFileConverter downstream, and thus the File producer handles a RemoteFile awkwardly when outputting a file.
Attachments
Attachments
Issue Links
- links to