camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Kettelerij <>
Subject Re: camel file :getName of file
Date Thu, 30 Dec 2010 16:40:51 GMT


One option is to add a custom processor to your route that retrieves the
filename and puts it in a property.
Then you can use this property in the exec command. It should look something
like this:

from("file://entree?delete=true") .process(new Processor() {
  public void process(Exchange exchange) throws Exception {
    File file = (File) exchange.getIn().getBody(File.class);
    exchange.setProperty("pickedUpFileName", file.getName())
${property.pickedUpFileName}.step -n -l 3")) 

Take a look at under "Read from a
directory and process the message in java". 

You can probably even skip the custom processor and work directly on the
body using the simple language (or another expression language). See
View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message