camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reuben Garrett <>
Subject Re: rename file with camel ftp
Date Mon, 20 Feb 2012 19:49:56 GMT

I don't have an immediate explanation, but I may have a solution.  Did you
observe any Exceptions being thrown?  If so, they could help trace the root
cause.  I suspect, however, that the GenericFile you're obtaining from the
Exchange is just a descriptor of sorts, and that changes to its name do not
automagically rename the underlying file - however I don't know for sure.

Beyond that, you may have better luck using the built-in moving behavior of
the FTP component by specifying a rename target in the endpoint URI's "move"
argument.  By default, bare tokens are interpreted as directories - however
you should be able to use an
Expression<>to fine-tune a
rename strategy as described in the File component's user

Hope this helps!
Reuben Garrett

On Sun, Feb 19, 2012 at 01:28, mcheng <> wrote:

> There is a file in ftp server and  I have made some  attempts to rename it,
> but it's always failed.
> Below is my code, can anyone give me some suggestions? I will be very
> appreciated.
> public void process(Exchange exchange) throws Exception {
>                                GenericFile genericFile = (GenericFile)
> exchange.getIn().getBody();
>                                genericFile.changeFileName("newName");
>                                exchange.getIn().setBody(genericFile);
> }
> --
> View this message in context:
> Sent from the Camel Development mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message