You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/11/25 14:24:11 UTC

[1/5] camel git commit: Enable Case Sensitive pattern match for file include and exclude

Repository: camel
Updated Branches:
  refs/heads/master e284fd657 -> 5091f938c


Enable Case Sensitive pattern match for file include and exclude


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b4d05211
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b4d05211
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b4d05211

Branch: refs/heads/master
Commit: b4d0521162e890209ef089c7417513a930d96e4e
Parents: e284fd6
Author: dwarakart <dw...@gmail.com>
Authored: Sat Nov 21 10:36:49 2015 +0000
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Nov 25 14:00:54 2015 +0100

----------------------------------------------------------------------
 .../component/file/GenericFileConsumer.java     | 20 +++++-
 .../component/file/GenericFileEndpoint.java     | 14 +++++
 ...ileConsumerExcludeNameCaseSensitiveTest.java | 58 ++++++++++++++++++
 .../file/FileConsumerExcludeNameTest.java       |  8 ++-
 ...rIncludeAndExcludeNameCaseSensitiveTest.java | 64 ++++++++++++++++++++
 .../FileConsumerIncludeAndExcludeNameTest.java  |  4 +-
 ...ileConsumerIncludeNameCaseSensitiveTest.java | 64 ++++++++++++++++++++
 .../file/FileConsumerIncludeNameTest.java       |  4 +-
 8 files changed, 229 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b4d05211/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
index d1f58d6..7fc75d4 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
@@ -597,14 +597,30 @@ public abstract class GenericFileConsumer<T> extends ScheduledBatchPollingConsum
             return true;
         }
 
+        // Check for case sensitive flag
+        boolean caseSensitive = true;
+        if (ObjectHelper.isNotEmpty(endpoint.getCaseSensitive())) {
+            caseSensitive = endpoint.getCaseSensitive();
+        }
+
         if (ObjectHelper.isNotEmpty(endpoint.getExclude())) {
-            if (name.matches(endpoint.getExclude())) {
+            String excludePattern = endpoint.getExclude();
+            if (caseSensitive == false ) {
+                if (name.toUpperCase().matches(excludePattern.toUpperCase())) {
+                    return false;
+                }
+            } else if (name.matches(excludePattern)) {
                 return false;
             }
         }
 
         if (ObjectHelper.isNotEmpty(endpoint.getInclude())) {
-            if (!name.matches(endpoint.getInclude())) {
+            String includePattern = endpoint.getInclude();
+            if (caseSensitive == false) {
+                if (!name.toUpperCase().matches(includePattern.toUpperCase())) {
+                    return false;
+                }
+            } else if (!name.matches(includePattern)) {
                 return false;
             }
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/b4d05211/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
index c81e2d3..7183847 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
@@ -129,6 +129,8 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
     protected String include;
     @UriParam(label = "consumer,filter")
     protected String exclude;
+    @UriParam(label = "consumer,filter", defaultValue = "true")
+    protected Boolean caseSensitive;
     @UriParam(label = "consumer,filter")
     protected Expression move;
     @UriParam(label = "consumer")
@@ -441,6 +443,18 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
         this.exclude = exclude;
     }
 
+    public Boolean getCaseSensitive() {
+        return caseSensitive;
+    }
+
+    /**
+     * Is used to determine if the include & exclude patterns are case sensitive or not
+     * @param caseSensitive
+     */
+    public void setCaseSensitive(Boolean caseSensitive) {
+        this.caseSensitive = caseSensitive;
+    }
+
     public String getAntInclude() {
         return antInclude;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/b4d05211/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameCaseSensitiveTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameCaseSensitiveTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameCaseSensitiveTest.java
new file mode 100644
index 0000000..bb243ff
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameCaseSensitiveTest.java
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.file;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * Unit test that file consumer will exclude pre and postfixes
+ */
+public class FileConsumerExcludeNameCaseSensitiveTest extends ContextTestSupport {
+
+    public void testExludePreAndPostfixes() throws Exception {
+        deleteDirectory("target/exclude");
+        prepareFiles();
+
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedBodiesReceived("Reports", "Reports", "Reports3");
+        mock.expectedMessageCount(3);
+        mock.assertIsSatisfied();
+    }
+
+    private void prepareFiles() throws Exception {
+        String url = "file://target/exclude";
+        template.sendBodyAndHeader(url, "Hello World", Exchange.FILE_NAME, "hello.xml");
+        template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report1.txt");
+        template.sendBodyAndHeader(url, "Bye World", Exchange.FILE_NAME, "secret.txt");
+        template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report2.txt");
+        template.sendBodyAndHeader(url, "Reports3", Exchange.FILE_NAME, "Report3.txt");
+        template.sendBodyAndHeader(url, "Secret2", Exchange.FILE_NAME, "Secret2.txt");
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("file://target/exclude/?exclude=^secret.*|.*xml$&caseSensitive=false")
+                    .convertBodyTo(String.class).to("mock:result");
+            }
+        };
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/b4d05211/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameTest.java
index fed3913..cda3e5a 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameTest.java
@@ -31,8 +31,8 @@ public class FileConsumerExcludeNameTest extends ContextTestSupport {
         prepareFiles();
 
         MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMessageCount(2);
-        mock.expectedBodiesReceived("Reports", "Reports");
+        mock.expectedBodiesReceived("Reports", "Reports", "Reports3", "Secret2");
+        mock.expectedMessageCount(4);
         mock.assertIsSatisfied();
     }
 
@@ -42,12 +42,14 @@ public class FileConsumerExcludeNameTest extends ContextTestSupport {
         template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report1.txt");
         template.sendBodyAndHeader(url, "Bye World", Exchange.FILE_NAME, "secret.txt");
         template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report2.txt");
+        template.sendBodyAndHeader(url, "Reports3", Exchange.FILE_NAME, "Report3.txt");
+        template.sendBodyAndHeader(url, "Secret2", Exchange.FILE_NAME, "Secret2.txt");
     }
 
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("file://target/exclude/?exclude=^secret.*|.*xml$")
+                from("file://target/exclude/?exclude=^secret.*|.*xml$&caseSensitive=true")
                     .convertBodyTo(String.class).to("mock:result");
             }
         };

http://git-wip-us.apache.org/repos/asf/camel/blob/b4d05211/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameCaseSensitiveTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameCaseSensitiveTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameCaseSensitiveTest.java
new file mode 100644
index 0000000..f4593ec
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameCaseSensitiveTest.java
@@ -0,0 +1,64 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.file;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * Unit test that file consumer will include/exclude pre and postfixes
+ */
+public class FileConsumerIncludeAndExcludeNameCaseSensitiveTest extends ContextTestSupport {
+
+    @Override
+    protected void setUp() throws Exception {
+        deleteDirectory("target/includeexclude");
+        super.setUp();
+    }
+
+    public void testIncludePreAndPostfixes() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedBodiesReceivedInAnyOrder("Report 2", "Report 3", "Report 4");
+        mock.expectedMessageCount(3);
+
+        sendFiles();
+
+        mock.assertIsSatisfied();
+    }
+
+    private void sendFiles() throws Exception {
+        String url = "file://target/includeexclude";
+        template.sendBodyAndHeader(url, "Hello World", Exchange.FILE_NAME, "hello.txt");
+        template.sendBodyAndHeader(url, "Report 1", Exchange.FILE_NAME, "report1.xml");
+        template.sendBodyAndHeader(url, "Report 2", Exchange.FILE_NAME, "report2.txt");
+        template.sendBodyAndHeader(url, "Report 3", Exchange.FILE_NAME, "report3.txt");
+        template.sendBodyAndHeader(url, "Report 4", Exchange.FILE_NAME, "Report4.txt");
+        template.sendBodyAndHeader(url, "Secret", Exchange.FILE_NAME, "Secret.txt");
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("file://target/includeexclude/?include=report.*txt&exclude=hello.*&caseSensitive=false")
+                    .convertBodyTo(String.class).to("mock:result");
+            }
+        };
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/b4d05211/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameTest.java
index 1124ad8..5ee697b 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameTest.java
@@ -48,12 +48,14 @@ public class FileConsumerIncludeAndExcludeNameTest extends ContextTestSupport {
         template.sendBodyAndHeader(url, "Report 1", Exchange.FILE_NAME, "report1.xml");
         template.sendBodyAndHeader(url, "Report 2", Exchange.FILE_NAME, "report2.txt");
         template.sendBodyAndHeader(url, "Report 3", Exchange.FILE_NAME, "report3.txt");
+        template.sendBodyAndHeader(url, "Report 4", Exchange.FILE_NAME, "Report4.txt");
+        template.sendBodyAndHeader(url, "Secret", Exchange.FILE_NAME, "Secret.txt");
     }
 
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("file://target/includeexclude/?include=.*txt&exclude=hello.*")
+                from("file://target/includeexclude/?include=report.*txt&exclude=hello.*")
                     .convertBodyTo(String.class).to("mock:result");
             }
         };

http://git-wip-us.apache.org/repos/asf/camel/blob/b4d05211/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameCaseSensitiveTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameCaseSensitiveTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameCaseSensitiveTest.java
new file mode 100644
index 0000000..a6b54a1
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameCaseSensitiveTest.java
@@ -0,0 +1,64 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.file;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * Unit test that file consumer will include pre and postfixes
+ */
+public class FileConsumerIncludeNameCaseSensitiveTest extends ContextTestSupport {
+
+    @Override
+    protected void setUp() throws Exception {
+        deleteDirectory("target/include");
+        super.setUp();
+    }
+
+    public void testIncludePreAndPostfixes() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedBodiesReceived("Reports", "Reports", "Reports3");
+        mock.expectedMessageCount(3);
+
+        sendFiles();
+
+        mock.assertIsSatisfied();
+    }
+
+    private void sendFiles() throws Exception {
+        String url = "file://target/include";
+        template.sendBodyAndHeader(url, "Hello World", Exchange.FILE_NAME, "hello.xml");
+        template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report1.txt");
+        template.sendBodyAndHeader(url, "Bye World", Exchange.FILE_NAME, "secret.txt");
+        template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report2.txt");
+        template.sendBodyAndHeader(url, "Reports3", Exchange.FILE_NAME, "Report3.txt");
+        template.sendBodyAndHeader(url, "Secret2", Exchange.FILE_NAME, "Secret2.txt");
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("file://target/include/?include=^report.*txt$&caseSensitive=false")
+                    .convertBodyTo(String.class).to("mock:result");
+            }
+        };
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/b4d05211/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameTest.java
index 822232b..50820f3 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameTest.java
@@ -34,8 +34,8 @@ public class FileConsumerIncludeNameTest extends ContextTestSupport {
 
     public void testIncludePreAndPostfixes() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMessageCount(2);
         mock.expectedBodiesReceived("Reports", "Reports");
+        mock.expectedMessageCount(2);
 
         sendFiles();
 
@@ -48,6 +48,8 @@ public class FileConsumerIncludeNameTest extends ContextTestSupport {
         template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report1.txt");
         template.sendBodyAndHeader(url, "Bye World", Exchange.FILE_NAME, "secret.txt");
         template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report2.txt");
+        template.sendBodyAndHeader(url, "Reports3", Exchange.FILE_NAME, "Report3.txt");
+        template.sendBodyAndHeader(url, "Secret2", Exchange.FILE_NAME, "Secret2.txt");
     }
 
     protected RouteBuilder createRouteBuilder() throws Exception {


[4/5] camel git commit: Polished. This fixes #687

Posted by da...@apache.org.
Polished. This fixes #687


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/acc42056
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/acc42056
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/acc42056

Branch: refs/heads/master
Commit: acc4205675182869acab1ba047e85d0eeb2c226f
Parents: e6f7c01
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Nov 25 14:17:35 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Nov 25 14:17:35 2015 +0100

----------------------------------------------------------------------
 .../component/file/GenericFileConsumer.java     | 27 +++++++++++++++-----
 .../component/file/GenericFileEndpoint.java     |  4 +--
 2 files changed, 22 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/acc42056/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
index 2084c57..0d31545 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
@@ -22,13 +22,13 @@ import java.util.Deque;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Queue;
+import java.util.regex.Pattern;
 
 import org.apache.camel.AsyncCallback;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.ShutdownRunningTask;
 import org.apache.camel.impl.ScheduledBatchPollingConsumer;
-import org.apache.camel.spi.UriParam;
 import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.StopWatch;
@@ -40,6 +40,9 @@ import org.slf4j.LoggerFactory;
  * Base class for file consumers.
  */
 public abstract class GenericFileConsumer<T> extends ScheduledBatchPollingConsumer {
+    private final Pattern excludePattern;
+    private final Pattern includePattern;
+
     protected final Logger log = LoggerFactory.getLogger(getClass());
     protected GenericFileEndpoint<T> endpoint;
     protected GenericFileOperations<T> operations;
@@ -48,7 +51,6 @@ public abstract class GenericFileConsumer<T> extends ScheduledBatchPollingConsum
     protected volatile ShutdownRunningTask shutdownRunningTask;
     protected volatile int pendingExchanges;
     protected Processor customProcessor;
-    @UriParam
     protected boolean eagerLimitMaxMessagesPerPoll = true;
     protected volatile boolean prepareOnStartup;
 
@@ -56,6 +58,17 @@ public abstract class GenericFileConsumer<T> extends ScheduledBatchPollingConsum
         super(endpoint, processor);
         this.endpoint = endpoint;
         this.operations = operations;
+
+        if (endpoint.getInclude() != null) {
+            this.includePattern = Pattern.compile(endpoint.getInclude(), Pattern.CASE_INSENSITIVE);
+        } else {
+            this.includePattern = null;
+        }
+        if (endpoint.getExclude() != null) {
+            this.excludePattern = Pattern.compile(endpoint.getExclude(), Pattern.CASE_INSENSITIVE);
+        } else {
+            this.excludePattern = null;
+        }
     }
 
     public Processor getCustomProcessor() {
@@ -597,14 +610,14 @@ public abstract class GenericFileConsumer<T> extends ScheduledBatchPollingConsum
             return true;
         }
 
-        if (ObjectHelper.isNotEmpty(endpoint.getExclude())) {
-            if (name.toUpperCase().matches(endpoint.getExclude().toUpperCase())) {
+        // exclude take precedence over include
+        if (excludePattern != null)  {
+            if (excludePattern.matcher(name).matches()) {
                 return false;
             }
         }
-
-        if (ObjectHelper.isNotEmpty(endpoint.getInclude())) {
-            if (!name.toUpperCase().matches(endpoint.getInclude().toUpperCase())) {
+        if (includePattern != null)  {
+            if (!includePattern.matcher(name).matches()) {
                 return false;
             }
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/acc42056/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
index c81e2d3..9c4586d 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
@@ -416,7 +416,7 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
     }
 
     /**
-     * Is used to include files, if filename matches the regex pattern.
+     * Is used to include files, if filename matches the regex pattern (matching is case in-senstive).
      * <p/>
      * Notice if you use symbols such as plus sign and others you would need to configure
      * this using the RAW() syntax if configuring this as an endpoint uri.
@@ -431,7 +431,7 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
     }
 
     /**
-     * Is used to exclude files, if filename matches the regex pattern.
+     * Is used to exclude files, if filename matches the regex pattern (matching is case in-senstive).
      * <p/>
      * Notice if you use symbols such as plus sign and others you would need to configure
      * this using the RAW() syntax if configuring this as an endpoint uri.


[3/5] camel git commit: Changes to make the file endpoint include & exclude patterns case insensitive by default

Posted by da...@apache.org.
Changes to make the file endpoint include & exclude patterns case insensitive by default


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b27dc454
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b27dc454
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b27dc454

Branch: refs/heads/master
Commit: b27dc454cb73aef9b30311ca1b2bf07661886c5b
Parents: b4d0521
Author: dwarakart <dw...@gmail.com>
Authored: Sun Nov 22 18:40:42 2015 +0000
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Nov 25 14:00:55 2015 +0100

----------------------------------------------------------------------
 .../component/file/GenericFileConsumer.java     | 22 +------
 .../component/file/GenericFileEndpoint.java     | 14 -----
 ...ileConsumerExcludeNameCaseSensitiveTest.java | 58 ------------------
 .../file/FileConsumerExcludeNameTest.java       |  6 +-
 ...rIncludeAndExcludeNameCaseSensitiveTest.java | 64 --------------------
 .../FileConsumerIncludeAndExcludeNameTest.java  |  4 +-
 ...ileConsumerIncludeNameCaseSensitiveTest.java | 64 --------------------
 .../file/FileConsumerIncludeNameTest.java       |  4 +-
 8 files changed, 10 insertions(+), 226 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b27dc454/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
index 7fc75d4..8d80a12 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
@@ -597,34 +597,18 @@ public abstract class GenericFileConsumer<T> extends ScheduledBatchPollingConsum
             return true;
         }
 
-        // Check for case sensitive flag
-        boolean caseSensitive = true;
-        if (ObjectHelper.isNotEmpty(endpoint.getCaseSensitive())) {
-            caseSensitive = endpoint.getCaseSensitive();
-        }
-
         if (ObjectHelper.isNotEmpty(endpoint.getExclude())) {
-            String excludePattern = endpoint.getExclude();
-            if (caseSensitive == false ) {
-                if (name.toUpperCase().matches(excludePattern.toUpperCase())) {
-                    return false;
-                }
-            } else if (name.matches(excludePattern)) {
+            if (name.toUpperCase().matches(endpoint.getExclude().toUpperCase())) {
                 return false;
             }
         }
 
         if (ObjectHelper.isNotEmpty(endpoint.getInclude())) {
-            String includePattern = endpoint.getInclude();
-            if (caseSensitive == false) {
-                if (!name.toUpperCase().matches(includePattern.toUpperCase())) {
-                    return false;
-                }
-            } else if (!name.matches(includePattern)) {
+            if (!name.toUpperCase().matches(endpoint.getInclude().toUpperCase())) {
                 return false;
             }
         }
-
+//Msno
         // use file expression for a simple dynamic file filter
         if (endpoint.getFileName() != null) {
             fileExpressionResult = evaluateFileExpression();

http://git-wip-us.apache.org/repos/asf/camel/blob/b27dc454/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
index 7183847..c81e2d3 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
@@ -129,8 +129,6 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
     protected String include;
     @UriParam(label = "consumer,filter")
     protected String exclude;
-    @UriParam(label = "consumer,filter", defaultValue = "true")
-    protected Boolean caseSensitive;
     @UriParam(label = "consumer,filter")
     protected Expression move;
     @UriParam(label = "consumer")
@@ -443,18 +441,6 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
         this.exclude = exclude;
     }
 
-    public Boolean getCaseSensitive() {
-        return caseSensitive;
-    }
-
-    /**
-     * Is used to determine if the include & exclude patterns are case sensitive or not
-     * @param caseSensitive
-     */
-    public void setCaseSensitive(Boolean caseSensitive) {
-        this.caseSensitive = caseSensitive;
-    }
-
     public String getAntInclude() {
         return antInclude;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/b27dc454/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameCaseSensitiveTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameCaseSensitiveTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameCaseSensitiveTest.java
deleted file mode 100644
index bb243ff..0000000
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameCaseSensitiveTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.file;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-
-/**
- * Unit test that file consumer will exclude pre and postfixes
- */
-public class FileConsumerExcludeNameCaseSensitiveTest extends ContextTestSupport {
-
-    public void testExludePreAndPostfixes() throws Exception {
-        deleteDirectory("target/exclude");
-        prepareFiles();
-
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedBodiesReceived("Reports", "Reports", "Reports3");
-        mock.expectedMessageCount(3);
-        mock.assertIsSatisfied();
-    }
-
-    private void prepareFiles() throws Exception {
-        String url = "file://target/exclude";
-        template.sendBodyAndHeader(url, "Hello World", Exchange.FILE_NAME, "hello.xml");
-        template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report1.txt");
-        template.sendBodyAndHeader(url, "Bye World", Exchange.FILE_NAME, "secret.txt");
-        template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report2.txt");
-        template.sendBodyAndHeader(url, "Reports3", Exchange.FILE_NAME, "Report3.txt");
-        template.sendBodyAndHeader(url, "Secret2", Exchange.FILE_NAME, "Secret2.txt");
-    }
-
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() throws Exception {
-                from("file://target/exclude/?exclude=^secret.*|.*xml$&caseSensitive=false")
-                    .convertBodyTo(String.class).to("mock:result");
-            }
-        };
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/b27dc454/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameTest.java
index cda3e5a..fd8d7cc 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExcludeNameTest.java
@@ -31,8 +31,8 @@ public class FileConsumerExcludeNameTest extends ContextTestSupport {
         prepareFiles();
 
         MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedBodiesReceived("Reports", "Reports", "Reports3", "Secret2");
-        mock.expectedMessageCount(4);
+        mock.expectedBodiesReceived("Reports", "Reports", "Reports3");
+        mock.expectedMessageCount(3);
         mock.assertIsSatisfied();
     }
 
@@ -49,7 +49,7 @@ public class FileConsumerExcludeNameTest extends ContextTestSupport {
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("file://target/exclude/?exclude=^secret.*|.*xml$&caseSensitive=true")
+                from("file://target/exclude/?exclude=^secret.*|.*xml$")
                     .convertBodyTo(String.class).to("mock:result");
             }
         };

http://git-wip-us.apache.org/repos/asf/camel/blob/b27dc454/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameCaseSensitiveTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameCaseSensitiveTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameCaseSensitiveTest.java
deleted file mode 100644
index f4593ec..0000000
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameCaseSensitiveTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.file;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-
-/**
- * Unit test that file consumer will include/exclude pre and postfixes
- */
-public class FileConsumerIncludeAndExcludeNameCaseSensitiveTest extends ContextTestSupport {
-
-    @Override
-    protected void setUp() throws Exception {
-        deleteDirectory("target/includeexclude");
-        super.setUp();
-    }
-
-    public void testIncludePreAndPostfixes() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedBodiesReceivedInAnyOrder("Report 2", "Report 3", "Report 4");
-        mock.expectedMessageCount(3);
-
-        sendFiles();
-
-        mock.assertIsSatisfied();
-    }
-
-    private void sendFiles() throws Exception {
-        String url = "file://target/includeexclude";
-        template.sendBodyAndHeader(url, "Hello World", Exchange.FILE_NAME, "hello.txt");
-        template.sendBodyAndHeader(url, "Report 1", Exchange.FILE_NAME, "report1.xml");
-        template.sendBodyAndHeader(url, "Report 2", Exchange.FILE_NAME, "report2.txt");
-        template.sendBodyAndHeader(url, "Report 3", Exchange.FILE_NAME, "report3.txt");
-        template.sendBodyAndHeader(url, "Report 4", Exchange.FILE_NAME, "Report4.txt");
-        template.sendBodyAndHeader(url, "Secret", Exchange.FILE_NAME, "Secret.txt");
-    }
-
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() throws Exception {
-                from("file://target/includeexclude/?include=report.*txt&exclude=hello.*&caseSensitive=false")
-                    .convertBodyTo(String.class).to("mock:result");
-            }
-        };
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/b27dc454/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameTest.java
index 5ee697b..b9ad5a2 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeAndExcludeNameTest.java
@@ -34,8 +34,8 @@ public class FileConsumerIncludeAndExcludeNameTest extends ContextTestSupport {
 
     public void testIncludePreAndPostfixes() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMessageCount(2);
-        mock.expectedBodiesReceivedInAnyOrder("Report 2", "Report 3");
+        mock.expectedBodiesReceivedInAnyOrder("Report 2", "Report 3", "Report 4");
+        mock.expectedMessageCount(3);
 
         sendFiles();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/b27dc454/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameCaseSensitiveTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameCaseSensitiveTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameCaseSensitiveTest.java
deleted file mode 100644
index a6b54a1..0000000
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameCaseSensitiveTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.file;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-
-/**
- * Unit test that file consumer will include pre and postfixes
- */
-public class FileConsumerIncludeNameCaseSensitiveTest extends ContextTestSupport {
-
-    @Override
-    protected void setUp() throws Exception {
-        deleteDirectory("target/include");
-        super.setUp();
-    }
-
-    public void testIncludePreAndPostfixes() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedBodiesReceived("Reports", "Reports", "Reports3");
-        mock.expectedMessageCount(3);
-
-        sendFiles();
-
-        mock.assertIsSatisfied();
-    }
-
-    private void sendFiles() throws Exception {
-        String url = "file://target/include";
-        template.sendBodyAndHeader(url, "Hello World", Exchange.FILE_NAME, "hello.xml");
-        template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report1.txt");
-        template.sendBodyAndHeader(url, "Bye World", Exchange.FILE_NAME, "secret.txt");
-        template.sendBodyAndHeader(url, "Reports", Exchange.FILE_NAME, "report2.txt");
-        template.sendBodyAndHeader(url, "Reports3", Exchange.FILE_NAME, "Report3.txt");
-        template.sendBodyAndHeader(url, "Secret2", Exchange.FILE_NAME, "Secret2.txt");
-    }
-
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() throws Exception {
-                from("file://target/include/?include=^report.*txt$&caseSensitive=false")
-                    .convertBodyTo(String.class).to("mock:result");
-            }
-        };
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/b27dc454/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameTest.java
index 50820f3..902622d 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIncludeNameTest.java
@@ -34,8 +34,8 @@ public class FileConsumerIncludeNameTest extends ContextTestSupport {
 
     public void testIncludePreAndPostfixes() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedBodiesReceived("Reports", "Reports");
-        mock.expectedMessageCount(2);
+        mock.expectedBodiesReceived("Reports", "Reports", "Reports3");
+        mock.expectedMessageCount(3);
 
         sendFiles();
 


[2/5] camel git commit: Changes to make the file endpoint include & exclude patterns case insensitive by default

Posted by da...@apache.org.
Changes to make the file endpoint include & exclude patterns case insensitive by default


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e6f7c017
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e6f7c017
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e6f7c017

Branch: refs/heads/master
Commit: e6f7c0178cf1353d8302c2f4e5dfe3fd28a9b4e5
Parents: b27dc45
Author: dwarakart <dw...@gmail.com>
Authored: Sun Nov 22 18:48:03 2015 +0000
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Nov 25 14:00:55 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/component/file/GenericFileConsumer.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e6f7c017/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
index 8d80a12..2084c57 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
@@ -608,7 +608,7 @@ public abstract class GenericFileConsumer<T> extends ScheduledBatchPollingConsum
                 return false;
             }
         }
-//Msno
+
         // use file expression for a simple dynamic file filter
         if (endpoint.getFileName() != null) {
             fileExpressionResult = evaluateFileExpression();


[5/5] camel git commit: Fixed CS

Posted by da...@apache.org.
Fixed CS


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5091f938
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5091f938
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5091f938

Branch: refs/heads/master
Commit: 5091f938c7d9613dc679b7b0d94e5e4927399cf2
Parents: acc4205
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Nov 25 14:24:00 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Nov 25 14:24:00 2015 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/file/GenericFileConsumer.java    | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5091f938/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
index 0d31545..f28aee5 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
@@ -40,9 +40,6 @@ import org.slf4j.LoggerFactory;
  * Base class for file consumers.
  */
 public abstract class GenericFileConsumer<T> extends ScheduledBatchPollingConsumer {
-    private final Pattern excludePattern;
-    private final Pattern includePattern;
-
     protected final Logger log = LoggerFactory.getLogger(getClass());
     protected GenericFileEndpoint<T> endpoint;
     protected GenericFileOperations<T> operations;
@@ -53,6 +50,8 @@ public abstract class GenericFileConsumer<T> extends ScheduledBatchPollingConsum
     protected Processor customProcessor;
     protected boolean eagerLimitMaxMessagesPerPoll = true;
     protected volatile boolean prepareOnStartup;
+    private final Pattern includePattern;
+    private final Pattern excludePattern;
 
     public GenericFileConsumer(GenericFileEndpoint<T> endpoint, Processor processor, GenericFileOperations<T> operations) {
         super(endpoint, processor);