Author: davsclaus
Date: Sat Aug 25 10:17:21 2012
New Revision: 1377251
URL: http://svn.apache.org/viewvc?rev=1377251&view=rev
Log:
CAMEL-5540: Fixed NPE when consuming from root dir with file consumer
Added:
camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/file/FileConsumeRootDirManualTest.java
- copied unchanged from r1377249,
camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/file/FileConsumeRootDirManualTest.java
Modified:
camel/branches/camel-2.9.x/ (props changed)
camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1377243
Merged /camel/branches/camel-2.10.x:r1377249
Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
URL:
http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java?rev=1377251&r1=1377250&r2=1377251&view=diff
==============================================================================
---
camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
(original)
+++
camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
Sat Aug 25 10:17:21 2012
@@ -138,7 +138,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 {