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 2013/11/18 11:49:04 UTC
[2/3] git commit: CAMEL-6967: Dont trunk file store if store not
created yet.
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 <da...@apache.org>
Authored: Mon Nov 18 11:50:00 2013 +0100
Committer: Claus Ibsen <da...@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 {