You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Christoph Giera (Jira)" <ji...@apache.org> on 2021/08/25 09:50:00 UTC

[jira] [Commented] (CAMEL-12724) Simple SFTP-to-File integration with charset options fails

    [ https://issues.apache.org/jira/browse/CAMEL-12724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17404321#comment-17404321 ] 

Christoph Giera commented on CAMEL-12724:
-----------------------------------------

Is it possible to downgrade it to 2.20.x too?

> Simple SFTP-to-File integration with charset options fails
> ----------------------------------------------------------
>
>                 Key: CAMEL-12724
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12724
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core, camel-ftp
>    Affects Versions: 2.22.0
>            Reporter: Tadayoshi Sato
>            Assignee: Tadayoshi Sato
>            Priority: Major
>             Fix For: 2.21.3, 2.22.1, 2.23.0
>
>         Attachments: SftpToFileTest.zip
>
>
> Simple SFTP-to-File integrations with {{charset}} conversion like:
> {code:java}
> from("sftp://sample@localhost:2222/in?password=password&delete=true&charset=ISO-8859-1")
>     .to("file:/tmp/samples-camel/SftpToFileTest/out?charset=UTF-8");
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)