Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expression

Description

file:name

refers to the file name

file:name.noext

refers to the file name with no extension

file:parent

refers to the file parent

file:path

refers to the file path

file:absolute

refers to the absolute file

file:canonical.path

refers to the canonical path

data:command:pattern

for date formatting using the java.text.SimepleDataFormat patterns. Supported commands are: now for current timestamp, file for the last modified timestamp of the file. in.header.xxx or header.xxx to use the Date object in the IN header with the key xxx. out.header.xxx to use the Date object in the OUT header with the key xxx.

bean:bean expression

invoking a bean expression using the Bean language.

simple:simple expression

to invoke the simple expression, however simple: can be omitted as this language extends the simple language

...

Code Block
expression="../backup/${date:now:yyyyMMdd}/type-${in.header.type}/backup-of-${file:name.noext}.bak"

If you have a custom Date you want to use in the expression then Camel supports retrieving dates from the message header.

Code Block

expression="orders/order-${in.header.customerId}-${date:in.header.orderDate:yyyyMMdd}.xml"

And finally we can also use a bean expression to invoke a POJO class that generates some String output (or convertible to String) to be used:

...