[ 
https://issues.apache.org/jira/browse/CAMEL-12724?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tadayoshi Sato updated CAMEL-12724:
-----------------------------------
    Attachment: SftpToFileTest.zip

> 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
>         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
(v7.6.3#76005)

Reply via email to