Hi Does anyone know how to get a file name without extension in camel. using spring xml.
I know ${header.CamelFileNameOnly} will give the full file name like "test.txt".
I would just like to get the name "test" and need to use this name in somewhere else, does anyone know how to do it ?
Use the file-expression language. Your route shall be something like
<camel:route>
<camel:from uri="file://input/orders" />
<camel:setHeader headerName="FileNameWithoutExtension">
<camel:simple>${file:onlyname.noext}</camel:simple>
</camel:setHeader>
</camel:route>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With