Details
Description
I'm trying to use the File component to move all *.txt files from the 'source' to the 'target' directory.
public void configure() throws Exception { from("file://source?fileName=%24%7Bfile%3Aonlyname.noext%7D.txt") .to("log://org.apache.camel.howto?showAll=true") .to("file://target"); }
I'm configuring the fileName as ${file:onlyname.noext}.txt.
However, not any file names match ever because the ${file:onlyname.noext} is always null because it's trying to obtain the file name from the exchange which is completely empty.
It seems to me that you should not create a DummyExchange:
https://github.com/apache/camel/blob/camel-2.25.x/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java#L701
Please find a demo project attached.
Attachments
Attachments
Issue Links
- relates to
-
CAMEL-15979 camel-file - Add includeExt/excludeExt to make it easy to filter based on file extension
- Resolved