tlsmith109 commented on a change in pull request #4620:
URL: https://github.com/apache/nifi/pull/4620#discussion_r539539229
##########
File path:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFileTransfer.java
##########
@@ -95,12 +96,19 @@ public void onTrigger(final ProcessContext context, final
ProcessSession session
}
final ComponentLog logger = getLogger();
- final String hostname =
context.getProperty(FileTransfer.HOSTNAME).evaluateAttributeExpressions(flowFile).getValue();
+
+ String hostname =
context.getProperty(FileTransfer.HOSTNAME).evaluateAttributeExpressions(flowFile).getValue();
+ //Check for constant attribute
+ final boolean staticHostname = hostname!=null && !hostname.isEmpty()
&& Objects.equals(hostname, context.getProperty(FileTransfer.HOSTNAME)
+ .getValue());
final int maxNumberOfFiles =
context.getProperty(FileTransfer.BATCH_SIZE).asInteger();
int fileCount = 0;
try (final T transfer = getFileTransfer(context)) {
do {
+ if(!staticHostname) {
Review comment:
Agree, good to know that exists! Also will allow me to not change test
to be able to allow expression evaluation.
----------------------------------------------------------------
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]