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

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


The following commit(s) were added to refs/heads/camel-2.21.x by this push:
     new 1585609  Fix DropboxAPIFacade.java
1585609 is described below

commit 158560961cb0aaeb062d430a328f4e9a66a9aa7e
Author: Tiago Rodrigues da Rosa <32721970+trr...@users.noreply.github.com>
AuthorDate: Sun Mar 25 20:17:05 2018 -0300

    Fix DropboxAPIFacade.java
    
    Specifically the bug was in class DropboxAPIFacade.java lines 114, 115, 
142, 143. The exception thrown is about upload a file into a not file path or a 
folder into a not folder path, but the new version of dropbox java sdk don't 
provides the method entry.isFile() or entry.isFolder(), and the code as is now, 
is throwing erroneous exceptions, if the file exists remotely, a exception will 
be thrown, and in config, we have the force mode, i think this snipped of code 
should be erased or t [...]
---
 .../org/apache/camel/component/dropbox/core/DropboxAPIFacade.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 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 4bfb887..1b43179 100644
--- 
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
@@ -111,7 +111,7 @@ public final class DropboxAPIFacade {
         // verify uploading of a single file
         if (fileLocalPath.isFile()) {
             // check if dropbox file exists
-            if (entry != null) {
+            if (entry != null && !DropboxUploadMode.force.equals(mode)) {
                 throw new DropboxException(dropboxPath + " exists on dropbox 
and is not a file!");
             }
             // in case the entry not exists on dropbox check if the filename
@@ -139,7 +139,7 @@ public final class DropboxAPIFacade {
             // verify uploading of a list of files inside a dir
             LOG.debug("Uploading a dir...");
             // check if dropbox folder exists
-            if (entry != null) {
+            if (entry != null && !DropboxUploadMode.force.equals(mode)) {
                 throw new DropboxException(dropboxPath + " exists on dropbox 
and is not a folder!");
             }
             if 
(!dropboxPath.endsWith(DropboxConstants.DROPBOX_FILE_SEPARATOR)) {

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

Reply via email to