[
https://issues.apache.org/jira/browse/CAMEL-11524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16088475#comment-16088475
]
ASF GitHub Bot commented on CAMEL-11524:
----------------------------------------
GitHub user onders86 opened a pull request:
https://github.com/apache/camel/pull/1823
CAMEL-11524-Add quoteReplacement
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/onders86/camel CAMEL-11524
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1823.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1823
----
commit f8cb4c3a2ff3cc5b15346c3d78f7f9bb1c22520b
Author: onders86 <[email protected]>
Date: 2017-07-15T05:33:59Z
CAMEL-11524-Add quoteReplacement
----
> Camel File Consumer fails when doneFileName contains '$'
> --------------------------------------------------------
>
> Key: CAMEL-11524
> URL: https://issues.apache.org/jira/browse/CAMEL-11524
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 2.18.2
> Environment: * Java8
> * Camel 2.18.2
> * Karaf 4.0.9
> Reporter: Saikat Ghosh
> Assignee: Önder Sezgin
> Priority: Minor
> Fix For: 2.18.5, 2.19.2, 2.20.0
>
>
> I have running a blueprint file with a camel context that has the following:
> {code:xml}
> <from
> uri="file:///{{backupFolder}}?doneFileName=${file:name}.4camel&recursive=true&delete=true"/>
> {code}
> This causes Camel to throw the following exception when I receive files with
> names of the following form:
> *YY049608$SQLEXPRESS_TEST1_FULL_20170709_160016.bak*
> Most likely the '$' in the name is the problem. Is there any way to escape it?
> {noformat}
> 2017-07-09 15:33:03,496 | WARN | %5Cbackup-folder | FileConsumer
> | 46 - org.apache.camel.camel-core - 2.18.2 | Consumer
> Consumer[file:///C:%5CUsers%5C300227639%5CDesktop%5Colivia-demo%5Cassembly%5Cdeployables%5C..%5Cdata%5Cbackup-folder?delete=true&doneFileName=%24%7Bfile%3Aname%7D.done&recursive=true]
> failed polling endpoint:
> file:///C:%5CUsers%5C300227639%5CDesktop%5Colivia-demo%5Cassembly%5Cdeployables%5C..%5Cdata%5Cbackup-folder?delete=true&doneFileName=%24%7Bfile%3Aname%7D.done&recursive=true.
> Will try again at next poll. Caused by: [java.lang.IllegalArgumentException
> - Illegal group reference]
> java.lang.IllegalArgumentException: Illegal group reference
> at
> java.util.regex.Matcher.appendReplacement(Matcher.java:857)[:1.8.0_101]
> at java.util.regex.Matcher.replaceFirst(Matcher.java:1004)[:1.8.0_101]
> at java.lang.String.replaceFirst(String.java:2178)[:1.8.0_101]
> at
> org.apache.camel.component.file.GenericFileEndpoint.createDoneFileName(GenericFileEndpoint.java:1301)[46:org.apache.camel.camel-core:2.18.2]
> at
> org.apache.camel.component.file.GenericFileConsumer.isMatched(GenericFileConsumer.java:670)[46:org.apache.camel.camel-core:2.18.2]
> at
> org.apache.camel.component.file.GenericFileConsumer.isValidFile(GenericFileConsumer.java:545)[46:org.apache.camel.camel-core:2.18.2]
> at
> org.apache.camel.component.file.FileConsumer.pollDirectory(FileConsumer.java:114)[46:org.apache.camel.camel-core:2.18.2]
> at
> org.apache.camel.component.file.FileConsumer.pollDirectory(FileConsumer.java:107)[46:org.apache.camel.camel-core:2.18.2]
> at
> org.apache.camel.component.file.FileConsumer.pollDirectory(FileConsumer.java:107)[46:org.apache.camel.camel-core:2.18.2]
> at
> org.apache.camel.component.file.FileConsumer.pollDirectory(FileConsumer.java:107)[46:org.apache.camel.camel-core:2.18.2]
> at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:132)[46:org.apache.camel.camel-core:2.18.2]
> at
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175)[46:org.apache.camel.camel-core:2.18.2]
> at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102)[46:org.apache.camel.camel-core:2.18.2]
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_101]
> at
> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_101]
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_101]
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_101]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
> at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
> {noformat}
> Thanks, Saycat
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)