You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2020/12/20 16:20:00 UTC
[jira] [Resolved] (CAMEL-15971) SimpleFileLanguage always null due
to DummyExchange
[ https://issues.apache.org/jira/browse/CAMEL-15971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-15971.
---------------------------------
Resolution: Fixed
> SimpleFileLanguage always null due to DummyExchange
> ---------------------------------------------------
>
> Key: CAMEL-15971
> URL: https://issues.apache.org/jira/browse/CAMEL-15971
> Project: Camel
> Issue Type: Bug
> Components: came-core
> Affects Versions: 2.23.2
> Reporter: Kurt Stam
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 3.7.1, 3.8.0, 2.25.4
>
> Attachments: camelftp.tgz
>
>
> I'm trying to use the File component to move all *.txt files from the 'source' to the 'target' directory.
> {code:java}
> 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");
> }
> {code}
> I'm configuring the fileName as ${file:onlyname.noext}.txt.
> https://github.com/apache/camel/blob/camel-2.25.x/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java#L85
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)