Hi
The file component supports moving files after processing using native
File.rename method. What you have in your route is a ending file
producer that writes a new file.
So if you want to move the file after the route completes you can do it as:
> --from("file://C://test//from").bean(MyClass,
> --"myMethod")
Notice the last file is gone. Now we need to instruct the first file
where it should move the file and what name it should be.
http://activemq.apache.org/camel/file.html
You can use the expression option to allow a bean to generate the
name. This expressions uses the file language
http://activemq.apache.org/camel/file-language.html
> --from("file://C://test//from?expression=myFileNameGeneratorBean").bean(MyClass,
> --"myMethod")
See the links ad they have samples.
/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/
On Wed, Dec 3, 2008 at 8:44 PM, Franklin Antony
<[EMAIL PROTECTED]> wrote:
>
> Thanks a lot.
> Just some more things.. Where exactly has the spring services need to be
> called or injected ?
>
> Also assume in this route
>
> --from("file://C://test//from").bean(MyClass,
> --"myMethod").to("file://C://test//to");
>
> Assume MyClass having myMethod can log to the database , since the message
> payload is received in MyClass. Now myMethod generates a Random Unique name
> for the file and log it into the database.
>
> How can the output (file://c://test/to) directory know what is the new name
> of the file ?
>
>
> Thanks,
> Franklin
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Apache-Camel-and-calling-Spring-Business-Services-tp20819198s22882p20820119.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>