Results 1 to 3 of 3

Thread: FTP outbound-channel-adapter file rename

  1. #1
    Join Date
    Dec 2010
    Posts
    3

    Default FTP outbound-channel-adapter file rename

    My target remote file is being moved to the home directory using ftp outbound-channel-adapter.
    Using an adapter like this:

    Code:
    <si-ftp:outbound-channel-adapter id="ftpOutbound"
    		channel="outChannel" session-factory="ftpSessionFactory" charset="UTF-8"
    		remote-directory="${ftpChannelRemoteWorkDestination}" />
    I see from the logs that at .writing file is appropriately created in the specified remote directory. Then a rename occurs that moves the file to the user's home directory on the FTP server without the .writing extension.

    I do like and need this rename feature in order to ensure files are complete before being touched, but I wonder why the remote directory is not used in the renamed file.

    I have found a work around for this by adding the following to the adapter:
    Code:
    remote-filename-generator-expression="'${ftpChannelRemoteWorkDestination}/'+payload.getName()"
    Is this a bug or intended behavior?

    Also, what is the best way to remove the local file after it has been successfully sent?
    I have not used channel interceptors before but would that work?
    It would be nice to have a "delete-local-files" attribute on the outbound adapter similar to the "delete-remote-files" on the inbound one.

    Just a thought, thanks for any help.

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    We discovered this bug yesterday and its already fixed
    https://jira.springframework.org/browse/INT-1704

    Can you possibly change your classpath to use nightly snapshots?
    Sorry about it

  3. #3
    Join Date
    Dec 2010
    Posts
    3

    Default

    Thanks for the quick reply. I will get the nightly snapshot.

    Any thoughts on deleting the local file once it has been successfully sent?
    Should I go down the channel interceptor road?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •