kpsngh1998 commented on a change in pull request #4515:
URL: https://github.com/apache/nifi/pull/4515#discussion_r501449404
##########
File path:
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/FetchS3Object.java
##########
@@ -139,6 +140,13 @@ public void onTrigger(final ProcessContext context, final
ProcessSession session
final String versionId =
context.getProperty(VERSION_ID).evaluateAttributeExpressions(flowFile).getValue();
final boolean requesterPays =
context.getProperty(REQUESTER_PAYS).asBoolean();
+ if (StringUtils.isEmpty(bucket) || StringUtils.isEmpty(key)) {
Review comment:
If I understood correctly, you are solving the case when bucket/key are
**""** or **sequence of whitespaces only** .
There are two things:
- org.apache.nifi.util.StringUtils.isEmpty don't check for whitespaces. So
instead of StringUtils.isEmpty you can use StringUtils.isBlank which also
checks for whitespaces. Or you can add StandardValidators.NON_BLANK_VALIDATOR
in both the properties validation which will show validation error for
whitespaces/empty strings.
- "Both 'Bucket' and 'Object Key' cannot be empty" This error message will
be logged even if only one is empty other is not, which is somewhat misleading.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]