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 2015/07/09 12:08:07 UTC

[1/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.

Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x faf4d4ac9 -> f23303783
  refs/heads/master 9ccce32ec -> cb70b3687


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/ef2e421b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ef2e421b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ef2e421b

Branch: refs/heads/master
Commit: ef2e421b49f1b40d93664cb630ff5520d219fe94
Parents: 9ccce32
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Jul 9 12:11:06 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Jul 9 12:11:06 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/ef2e421b/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");
+                    }
                 }
             }
         }


[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.

Posted by da...@apache.org.
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 <da...@apache.org>
Authored: Thu Jul 9 12:13:58 2015 +0200
Committer: Claus Ibsen <da...@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");
+                    }
                 }
             }
         }


[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.

Posted by da...@apache.org.
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 <da...@apache.org>
Authored: Thu Jul 9 12:11:06 2015 +0200
Committer: Claus Ibsen <da...@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");
+                    }
                 }
             }
         }


[2/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.

Posted by da...@apache.org.
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/cb70b368
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cb70b368
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cb70b368

Branch: refs/heads/master
Commit: cb70b368775f3bf570a26c5d2d75704a8b3357c7
Parents: ef2e421
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Jul 9 12:13:58 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Jul 9 12:13:58 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/cb70b368/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");
+                    }
                 }
             }
         }