Results 1 to 2 of 2

Thread: Delete File after readed

  1. #1
    Join Date
    Apr 2012
    Posts
    27

    Default Delete File after readed

    How i can delete a file after readed?
    I mean, i have a inbound adapter for read a file from system file and send to a Queue, and i want to delete the file after delivery...

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

    Default

    Well, the simples way to do that would be to use the new feature of Spring Integration 2.2 - Transaction Synchronization which allows you to synchronize user operations with a completed transaction. Obviously File is not a transactional system, but for the convenience we provide a PseudoTransctionManager to accomplish that.
    Anyway, you can get more details from one of the blogs we did few weeks ago (by Gary Russell) http://blog.springsource.org/2012/09...nchronization/

    In fact the example there is using file adapter and renames the file after its been read, but you can easily execute delete() command instead of rename.
    Hope that helps

Posting Permissions

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