camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: SFTP rename of a file
Date Thu, 21 Jul 2011 19:03:16 GMT
On Thu, Jul 21, 2011 at 7:26 PM, AnujK <reachanuj@gmail.com> wrote:
> Thanks!.
>
> So, how can we just rename the file programmatically.
>
> I am using ProducerTemplate to execute a 'move' command but it has no
> effect.
>
> producerTemplate.sendBodyAndHeader("sftp://127.0.0.1?binary=true&username=test&password=test&move=.camel&fileName=test.gzip",
>                "test.gzip", Exchange.FILE_NAME_ONLY, "test.gzip");
>
> I would like the file test.gzip to be renamed to test.gzip.camel.
>

That is because its a producer, so it sends (uploads) a file to a FTP server.
Its the consumer (which downloads) the file from the FTP server, that
after the download, can move the file.

For that you need to use the consumer template instead.

You can possible also programmatically issue a move (rename)
operation. The FtpEndpoint ought you to be abel to access the
FtpOperations where you can issues these commands.



> Our use case calls for invoking the above code multiple times for all the
> files that we have processed
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/SFTP-rename-of-a-file-tp4618433p4620350.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message