Results 1 to 5 of 5

Thread: Is it possible to send a "rename file on FTP" message

  1. #1
    Join Date
    Aug 2008
    Posts
    6

    Default Is it possible to send a "rename file on FTP" message

    Hi, I have a colleague that is writing a a batch that needs to poll an FTP, then download the file, then rename/move it on the FTP, then process the file locally, then once finished rename/move the original file on the FTP.

    So the file life on the FTP would be something like :
    0. somefile.zip is put on the FTP by an external entity
    1. somefile.zip downloaded by the SpringIntegration
    2. somefile.zip renamed on the FTP to somefile.zip.processing_started
    3. somefile.zip is being processed by the bathc
    4. somefile.zip is renamed on the FTP to somefile.zip.processing_successful


    So the idea was to use a channel adapter to perform such rename/move operation through a message.

    Any hints or ideas to explore in order to achieve feature would be very welcome.

    Note, I 'm saying rename/move because the FTP commands RNFR/RNTO are used to rename or move with the whole path.

    Thx in advance
    Last edited by Brice; Mar 6th, 2013 at 10:45 AM.

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,037

    Default

    This is not currently supported, but this would be a nice addition to the (S)FTP outbound gateways, which currently support ls, rm, get, mget.

    This would not be a difficult addition because the underlying Session object (FtpSession, SftpSession) has a
    Code:
    void rename(String pathFrom, String pathTo)
    method.

    Feel free to open a 'New Feature' JIRA issue https://jira.springsource.org/browse/INT

    If you'd be interested in making a contribution, see: https://github.com/SpringSource/spri...ONTRIBUTING.md
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Aug 2008
    Posts
    6

    Default

    Hi Gary thx for the info, and sorry for the late reply, we are moving fast so we got with our own solution, still contributing would be interesting. Thx for the proposition. I will see how my schedule pans out...

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,037

    Default

    Actually, I have now implemented it; https://jira.springsource.org/browse/INT-2981 and there's an open pull request waiting to be merged.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  5. #5
    Join Date
    Aug 2008
    Posts
    6

    Default

    Cool, thx Gary

Tags for this Thread

Posting Permissions

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