Author: davsclaus
Date: Sat Aug 25 10:15:35 2012
New Revision: 1377249
URL: http://svn.apache.org/viewvc?rev=1377249&view=rev
Log:
CAMEL-5540: Fixed NPE when consuming from root dir with file consumer
Added:
camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/file/FileConsumeRootDirManualTest.java
- copied unchanged from r1377243,
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumeRootDirManualTest.java
Modified:
camel/branches/camel-2.10.x/ (props changed)
camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1377243
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
URL:
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java?rev=1377249&r1=1377248&r2=1377249&view=diff
==============================================================================
---
camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
(original)
+++
camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
Sat Aug 25 10:15:35 2012
@@ -139,7 +139,7 @@ public class FileConsumer extends Generi
// compute the file path as relative to the starting directory
File path;
String endpointNormalized = FileUtil.normalizePath(endpointPath);
- if (file.getPath().startsWith(endpointNormalized)) {
+ if (file.getPath().startsWith(endpointNormalized + File.separator)) {
// skip duplicate endpoint path
path = new File(ObjectHelper.after(file.getPath(),
endpointNormalized + File.separator));
} else {