Announcement Announcement Module
Collapse
No announcement yet.
Is it possible to send a "rename file on FTP" message Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 10:45 AM.

  • #2
    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

    Comment


    • #3
      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...

      Comment


      • #4
        Actually, I have now implemented it; https://jira.springsource.org/browse/INT-2981 and there's an open pull request waiting to be merged.

        Comment


        • #5
          Cool, thx Gary

          Comment

          Working...
          X