Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16015

SFTP to file with local work directory is not using rename

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.4.5
    • 3.10.0
    • camel-ftp
    • None
    • Unknown

    Description

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            gregvh Grégory Van Herck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment