kotarot commented on a change in pull request #4515:
URL: https://github.com/apache/nifi/pull/4515#discussion_r502182250
##########
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:
In my opinion, if we set 'bucket name' property to " " (a string with
whitespaces only) or an expression language whose evaluated value is " ",
the flowfile correctly goes to failure relationship with "The specified bucket
does not exist" or "The specified key does not exist" errors already. So the
checking for Empty here is enough, in my opinion.
Also, unfortunately, adding `StandardValidators.NON_BLANK_VALIDATOR` does
not work because an empty string appears after evaluating an expression
language. The expression language passes through this validator. Note that for
these properties, `StandardValidators.NON_EMPTY_VALIDATOR` is already applied.
- Please see:
-
https://github.com/apache/nifi/blob/a95ffce6bd451fc4a65bb1be9346a05fd42c0f41/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/s3/AbstractS3Processor.java#L111
-
https://github.com/apache/nifi/blob/a95ffce6bd451fc4a65bb1be9346a05fd42c0f41/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/s3/AbstractS3Processor.java#L116
Regarding the error message, it makes sence, I'll fix it. Thank you for
pointing it out!
----------------------------------------------------------------
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]