You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Chandrakant Hardahe (Jira)" <ji...@apache.org> on 2021/01/14 05:01:00 UTC

[jira] [Commented] (CAMEL-16015) SFTP to file with local work directory is not using rename

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

Chandrakant Hardahe commented on CAMEL-16015:
---------------------------------------------

Thanks [~gregvh] for bringing this into notice, I'll look into it

> SFTP to file with local work directory is not using rename
> ----------------------------------------------------------
>
>                 Key: CAMEL-16015
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16015
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 3.4.5
>            Reporter: Grégory Van Herck
>            Priority: Minor
>
> When doing SFTP to file with the local work directory option, like described here:
> [https://camel.apache.org/components/latest/ftp-component.html#_using_local_work_directory]
> The target file should be written by renaming the local work file.
> Instead, it is written by InputStream because of the following code in FileOperations:
> {{if (body instanceof WrappedFile) {}}
> {{     body = ((WrappedFile<?>)body).getFile();}}
> {{}}}
> {{if (body instanceof File) {}}
> {{     source = (File)body;}}
> {{     fileBased = true;}}
> {{}}}
>  
> The exchange contains a RemoteFile and after unwrapping, a SftpRemoteFileJCraft which is not a File. The exchange is not marked as fileBased and the local work file is therefore not used.
> Issue was discovered on version 3.4.5 but might affect other versions.



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