Repository: camel Updated Branches: refs/heads/master 0546713dd -> b2c6212f9
CAMEL-11680: Camel-dropbox should support Put not only from localPath Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b2c6212f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b2c6212f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b2c6212f Branch: refs/heads/master Commit: b2c6212f99bea922981d8ed077f647ac0f9aa74f Parents: 0546713 Author: Claus Ibsen <[email protected]> Authored: Wed Sep 6 15:58:12 2017 +0200 Committer: Claus Ibsen <[email protected]> Committed: Wed Sep 6 15:58:12 2017 +0200 ---------------------------------------------------------------------- .../validator/DropboxConfigurationValidator.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/b2c6212f/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/validator/DropboxConfigurationValidator.java ---------------------------------------------------------------------- diff --git a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/validator/DropboxConfigurationValidator.java b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/validator/DropboxConfigurationValidator.java index 4c1e0b4..e6564e4 100755 --- a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/validator/DropboxConfigurationValidator.java +++ b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/validator/DropboxConfigurationValidator.java @@ -24,6 +24,7 @@ import org.apache.camel.component.dropbox.DropboxConfiguration; import org.apache.camel.component.dropbox.util.DropboxConstants; import org.apache.camel.component.dropbox.util.DropboxException; import org.apache.camel.component.dropbox.util.DropboxUploadMode; +import org.apache.camel.util.ObjectHelper; public final class DropboxConfigurationValidator { @@ -72,17 +73,15 @@ public final class DropboxConfigurationValidator { } private static void validateLocalPath(String localPath) throws DropboxException { - if (localPath == null || localPath.equals("")) { - throw new DropboxException("option <localPath> is not present or not valid!"); - } - File file = new File(localPath); - if (!file.exists()) { - throw new DropboxException("option <localPath> is not an existing file or directory!"); + if (ObjectHelper.isNotEmpty(localPath)) { + File file = new File(localPath); + if (!file.exists()) { + throw new DropboxException("option <localPath> is not an existing file or directory!"); + } } } private static void validateRemotePath(String remotePath) throws DropboxException { - if (remotePath == null || !remotePath.startsWith(DropboxConstants.DROPBOX_FILE_SEPARATOR)) { throw new DropboxException("option <remotePath> is not valid!"); }
