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 2017/03/14 17:34:44 UTC

[06/10] camel git commit: CAMEL-10791-added option to handle empty directories while unzipping

CAMEL-10791-added option to handle empty directories while unzipping


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

Branch: refs/heads/master
Commit: c2b2ee2ed5f14e12f3f794c12b6f920c9fea6935
Parents: 0eeeaaf
Author: onders86 <on...@gmail.com>
Authored: Mon Mar 13 11:10:23 2017 +0300
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Mar 14 18:29:38 2017 +0100

----------------------------------------------------------------------
 .../camel/component/file/GenericFileProducer.java   |   6 +-----
 .../camel-zipfile/src/test/resources/hello.odt      | Bin 0 -> 8039 bytes
 2 files changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c2b2ee2e/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
index 7e8cd61..a4769ec 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
@@ -274,11 +274,7 @@ public class GenericFileProducer<T> extends DefaultProducer {
             log.trace("About to write [{}] to [{}] from exchange [{}]", new Object[]{fileName, getEndpoint(), exchange});
         }
 
-        // if filename indicates the current directory and the directory is created
-        // but no need to store a file under the directory like touch <dir>
-        // this is added due to considering to handle empty directories in zipfile 
-        boolean success = !fileName.substring(fileName.lastIndexOf(File.separator) + 1, fileName.length()).equals(".")
-                                            ? operations.storeFile(fileName, exchange) : true;
+        boolean success = operations.storeFile(fileName, exchange);
         if (!success) {
             throw new GenericFileOperationFailedException("Error writing file [" + fileName + "]");
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/c2b2ee2e/components/camel-zipfile/src/test/resources/hello.odt
----------------------------------------------------------------------
diff --git a/components/camel-zipfile/src/test/resources/hello.odt b/components/camel-zipfile/src/test/resources/hello.odt
new file mode 100644
index 0000000..223391a
Binary files /dev/null and b/components/camel-zipfile/src/test/resources/hello.odt differ