camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/4] camel git commit: CAMEL-8768: hdfs2 component overwrite option is also being applied to directory filesystem path. Thanks to Hassan Faouaz for the patch.
Date Thu, 09 Jul 2015 10:08:09 GMT
CAMEL-8768: hdfs2 component overwrite option is also being applied to directory filesystem
path. Thanks to Hassan Faouaz for the patch.


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

Branch: refs/heads/camel-2.15.x
Commit: 4d719eb58c0ec8503cdc9341027a0e981ebe1463
Parents: faf4d4a
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Jul 9 12:11:06 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Jul 9 12:14:23 2015 +0200

----------------------------------------------------------------------
 .../apache/camel/component/hdfs2/HdfsOutputStream.java   | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4d719eb5/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOutputStream.java
----------------------------------------------------------------------
diff --git a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOutputStream.java
b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOutputStream.java
index 568108e..4bd2510 100644
--- a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOutputStream.java
+++ b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOutputStream.java
@@ -59,10 +59,13 @@ public class HdfsOutputStream implements Closeable {
             }
         } else {
             if (ret.info.getFileSystem().exists(new Path(ret.actualPath))) {
-                if (configuration.isOverwrite()) {
-                    ret.info.getFileSystem().delete(new Path(ret.actualPath), true);
-                } else {
-                    throw new RuntimeCamelException("The file already exists");
+                //only check if not directory
+                if (!ret.info.getFileSystem().isDirectory(new Path(ret.actualPath))) {
+                    if (configuration.isOverwrite()) {
+                        ret.info.getFileSystem().delete(new Path(ret.actualPath), true);
+                    } else {
+                        throw new RuntimeCamelException("The file already exists");
+                    }
                 }
             }
         }


Mime
View raw message