camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/3] git commit: CAMEL-6967: Dont trunk file store if store not created yet.
Date Mon, 18 Nov 2013 10:49:04 GMT
CAMEL-6967: Dont trunk file store if store not created yet.


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

Branch: refs/heads/camel-2.12.x
Commit: 6204c43bd454c63225218d868c4e421a4ddf884e
Parents: 6751da9
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Nov 18 11:50:00 2013 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Nov 18 11:50:18 2013 +0100

----------------------------------------------------------------------
 .../processor/idempotent/FileIdempotentRepository.java    | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6204c43b/camel-core/src/main/java/org/apache/camel/processor/idempotent/FileIdempotentRepository.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/idempotent/FileIdempotentRepository.java
b/camel-core/src/main/java/org/apache/camel/processor/idempotent/FileIdempotentRepository.java
index c1d0704..c1e4e30 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/idempotent/FileIdempotentRepository.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/idempotent/FileIdempotentRepository.java
@@ -250,6 +250,10 @@ public class FileIdempotentRepository extends ServiceSupport implements
Idempote
      * to the file store.
      */
     protected void trunkStore() {
+        if (fileStore == null || !fileStore.exists()) {
+            return;
+        }
+
         LOG.info("Trunking idempotent filestore: {}", fileStore);
         FileOutputStream fos = null;
         try {
@@ -269,12 +273,12 @@ public class FileIdempotentRepository extends ServiceSupport implements
Idempote
      * Loads the given file store into the 1st level cache
      */
     protected void loadStore() {
-        LOG.trace("Loading to 1st level cache from idempotent filestore: {}", fileStore);
-
-        if (!fileStore.exists()) {
+        if (fileStore == null || !fileStore.exists()) {
             return;
         }
 
+        LOG.trace("Loading to 1st level cache from idempotent filestore: {}", fileStore);
+
         cache.clear();
         Scanner scanner = null;
         try {


Mime
View raw message