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 2018/02/02 09:51:04 UTC

[camel] branch camel-2.20.x updated (c1fce7d -> c3351f9)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch camel-2.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from c1fce7d  CAMEL-11996: RabbitConsumer could hang when RabbitMQ connection is lost and autoAck=false. Thanks to Joel MongÄrd for the unit test.
     new 30d1cb6  CAMEL-12176: Fixed doc to say that query is required in dropbox search operation.
     new c3351f9  CAMEL-12176: Include nested exception when camel-dropbox fails.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel-dropbox/src/main/docs/dropbox-component.adoc   | 14 ++++++++------
 .../camel/component/dropbox/core/DropboxAPIFacade.java   | 16 ++++++++--------
 .../camel/component/dropbox/util/DropboxException.java   |  4 ++++
 3 files changed, 20 insertions(+), 14 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.

[camel] 01/02: CAMEL-12176: Fixed doc to say that query is required in dropbox search operation.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 30d1cb67ef7ac8048eb2644a53b9b45a818c1352
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 2 10:46:17 2018 +0100

    CAMEL-12176: Fixed doc to say that query is required in dropbox search operation.
---
 .../camel-dropbox/src/main/docs/dropbox-component.adoc     | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/components/camel-dropbox/src/main/docs/dropbox-component.adoc b/components/camel-dropbox/src/main/docs/dropbox-component.adoc
index beae12f..d0c01c3 100644
--- a/components/camel-dropbox/src/main/docs/dropbox-component.adoc
+++ b/components/camel-dropbox/src/main/docs/dropbox-component.adoc
@@ -17,14 +17,14 @@ Maven users will need to add the following dependency to their `pom.xml`
 for this component:
 
 [source,xml]
-------------------------------------------------------------
+----
 <dependency>
     <groupId>org.apache.camel</groupId>
     <artifactId>camel-dropbox</artifactId>
     <version>x.x.x</version>
     <!-- use the same version as your Camel core version -->
 </dependency>
-------------------------------------------------------------
+----
 
 === URI format
 
@@ -39,7 +39,7 @@ perform on Dropbox remote folder.
 === Operations
 
 [width="100%",cols="40%,60%",options="header",]
-|=======================================================================
+|===
 |Operation |Description
 
 |`del` |deletes files or directories on Dropbox
@@ -51,7 +51,7 @@ perform on Dropbox remote folder.
 |`put` |upload files on Dropbox
 
 |`search` |search files on Dropbox based on string queries
-|=======================================================================
+|===
 
 *Operations* require additional options to work, some are mandatory for
 the specific operation.
@@ -360,9 +360,10 @@ Below are listed the options for this operation:
 
 |`remotePath` |`true` |Folder on Dropbox where to search in.
 
-|`query` |`false` |A space-separated list of sub-strings to search for. A file matches only
+|`query` |`true` |A space-separated list of sub-strings to search for. A file matches only
 if it contains all the sub-strings. If this option is not set, all files
-will be matched.
+will be matched. The query is required to be provided in either the endpoint configuration
+or as a header `CamelDropboxQuery` on the Camel message.
 |===
 
 ==== Samples
@@ -373,6 +374,7 @@ from("dropbox://search?accessToken=XXX&clientIdentifier=XXX&remotePath=/XXX&quer
   .to("mock:result");
 
 from("direct:start")
+  .setHeader("CamelDropboxQuery", constant("XXX"))
   .to("dropbox://search?accessToken=XXX&clientIdentifier=XXX&remotePath=/XXX")
   .to("mock:result");
 ----

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.

[camel] 02/02: CAMEL-12176: Include nested exception when camel-dropbox fails.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c3351f9bd063bc825a23a51dbe002f9864f92f24
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 2 10:50:08 2018 +0100

    CAMEL-12176: Include nested exception when camel-dropbox fails.
---
 .../camel/component/dropbox/core/DropboxAPIFacade.java   | 16 ++++++++--------
 .../camel/component/dropbox/util/DropboxException.java   |  4 ++++
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/core/DropboxAPIFacade.java b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/core/DropboxAPIFacade.java
index 7992aa1..4bfb887 100755
--- a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/core/DropboxAPIFacade.java
+++ b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/core/DropboxAPIFacade.java
@@ -96,7 +96,7 @@ public final class DropboxAPIFacade {
         try {
             entry = client.files().upload(dropboxPath);
         } catch (DbxException e) {
-            throw new DropboxException(dropboxPath + " does not exist or can't obtain metadata");
+            throw new DropboxException(dropboxPath + " does not exist or cannot obtain metadata", e);
         }
 
         if (localPath != null) {
@@ -150,7 +150,7 @@ public final class DropboxAPIFacade {
             // list all files in a dir
             Collection<File> listFiles = FileUtils.listFiles(fileLocalPath, null, true);
             if (listFiles.isEmpty()) {
-                throw new DropboxException(localPath + " doesn't contain any files");
+                throw new DropboxException(localPath + " does not contain any files");
             }
 
             HashMap<String, DropboxResultCode> resultMap = new HashMap<>(listFiles.size());
@@ -271,7 +271,7 @@ public final class DropboxAPIFacade {
                 searchMatches = listing.getMatches();
                 return new DropboxSearchResult(searchMatches);
             } catch (DbxException e) {
-                throw new DropboxException(remotePath + " does not exist or can't obtain metadata");
+                throw new DropboxException(remotePath + " does not exist or cannot obtain metadata", e);
             }
         } else {
             LOG.debug("Search by query: {}", query);
@@ -280,7 +280,7 @@ public final class DropboxAPIFacade {
                 searchMatches = listing.getMatches();
                 return new DropboxSearchResult(searchMatches);
             } catch (DbxException e) {
-                throw new DropboxException(remotePath + " does not exist or can't obtain metadata");
+                throw new DropboxException(remotePath + " does not exist or cannot obtain metadata", e);
             }
         }
     }
@@ -297,7 +297,7 @@ public final class DropboxAPIFacade {
         try {
             client.files().deleteV2(remotePath);
         } catch (DbxException e) {
-            throw new DropboxException(remotePath + " does not exist or can't obtain metadata");
+            throw new DropboxException(remotePath + " does not exist or cannot obtain metadata", e);
         }
         return new DropboxDelResult(remotePath);
     }
@@ -315,7 +315,7 @@ public final class DropboxAPIFacade {
             client.files().moveV2(remotePath, newRemotePath);
             return new DropboxMoveResult(remotePath, newRemotePath);
         } catch (DbxException e) {
-            throw new DropboxException(remotePath + " does not exist or can't obtain metadata");
+            throw new DropboxException(remotePath + " does not exist or cannot obtain metadata", e);
         }
     }
 
@@ -369,9 +369,9 @@ public final class DropboxAPIFacade {
                 return null;
             }
         } catch (DbxException e) {
-            throw new DropboxException(path + " does not exist or can't obtain metadata");
+            throw new DropboxException(path + " does not exist or cannot obtain metadata", e);
         } catch (IOException e) {
-            throw new DropboxException(path + " can't obtain a stream");
+            throw new DropboxException(path + " cannot obtain a stream", e);
         }
     }
 }
diff --git a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/util/DropboxException.java b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/util/DropboxException.java
index e900fe8..b091429 100755
--- a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/util/DropboxException.java
+++ b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/util/DropboxException.java
@@ -27,4 +27,8 @@ public class DropboxException extends Exception {
     public DropboxException(String message) {
         super(message);
     }
+
+    public DropboxException(String message, Throwable cause) {
+        super(message, cause);
+    }
 }

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.