You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/06/04 07:01:58 UTC

[GitHub] [camel] orpiske commented on a diff in pull request #7721: CAMEL-17941 - Dropbox: long-lived access tokens are retired, must use…

orpiske commented on code in PR #7721:
URL: https://github.com/apache/camel/pull/7721#discussion_r889496254


##########
components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/validator/DropboxConfigurationValidator.java:
##########
@@ -33,6 +33,18 @@ public static void validateCommonProperties(DropboxConfiguration configuration)
         if (configuration.getAccessToken() == null || configuration.getAccessToken().equals("")) {
             throw new DropboxException("option <accessToken> is not present or not valid!");
         }
+        if (configuration.getExpireIn() == null || configuration.getExpireIn() <= 0) {
+            throw new DropboxException("option <expireIn> is not present or not valid!");
+        }
+        if (configuration.getRefreshToken() == null || configuration.getRefreshToken().equals("")) {
+            throw new DropboxException("option <refreshToken> is not present or not valid!");
+        }
+        if (configuration.getApiKey() == null || configuration.getApiKey().equals("")) {

Review Comment:
   I think you can use `ObjectHelper.isEmpty` here and in the others with the same logic.



##########
components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/validator/DropboxConfigurationValidator.java:
##########
@@ -33,6 +33,18 @@ public static void validateCommonProperties(DropboxConfiguration configuration)
         if (configuration.getAccessToken() == null || configuration.getAccessToken().equals("")) {
             throw new DropboxException("option <accessToken> is not present or not valid!");
         }
+        if (configuration.getExpireIn() == null || configuration.getExpireIn() <= 0) {
+            throw new DropboxException("option <expireIn> is not present or not valid!");
+        }
+        if (configuration.getRefreshToken() == null || configuration.getRefreshToken().equals("")) {

Review Comment:
   I think you can use `ObjectHelper.isEmpty` here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org