Question

If I send direct:report a byte[]. How do I find out the absolute path and name of the file it was written to?

from("direct:report").to("file:target/reports");
Was it helpful?

Solution

The file producer will add an header with the key CamelFileNameProduced which contains the actual name of the file written.

The actual absolute filepath (path + name) for the output file that was written. This header is set by Camel and its purpose is providing end-users with the name of the file that was written.

OTHER TIPS

Use the "fileName" attribute to set the name explicitly. The path is relative to your container (junit, servicemix, etc)...so the full path to your file would be [container-root]/target/reports/[fileName]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top