camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [4/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:10 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/f2330378
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f2330378
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f2330378

Branch: refs/heads/camel-2.15.x
Commit: f2330378362ddf729f69f23f3da440615ddd3736
Parents: 4d719eb
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Jul 9 12:13:58 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Jul 9 12:14:29 2015 +0200

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


http://git-wip-us.apache.org/repos/asf/camel/blob/f2330378/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsOutputStream.java
----------------------------------------------------------------------
diff --git a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsOutputStream.java
b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsOutputStream.java
index 8a7b336..a8f8db1 100644
--- a/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsOutputStream.java
+++ b/components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/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