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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]