exceptionfactory commented on code in PR #10541:
URL: https://github.com/apache/nifi/pull/10541#discussion_r2553322791


##########
nifi-extension-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/PutSmbFile.java:
##########
@@ -285,15 +288,17 @@ private void 
createMissingDirectoriesRecursevly(ComponentLog logger, DiskShare s
     @Override
     public void onTrigger(final ProcessContext context, final ProcessSession 
session) throws ProcessException {
         final int batchSize = context.getProperty(BATCH_SIZE).asInteger();
-        List<FlowFile> flowFiles = session.get(batchSize);
+        final HostnameAndShareFlowFileFilter fileFilter = new 
HostnameAndShareFlowFileFilter(context, batchSize);
+        final List<FlowFile> flowFiles = session.get(fileFilter);
         if ( flowFiles.isEmpty() ) {
             return;
         }
         final ComponentLog logger = getLogger();
         logger.debug("Processing next {} flowfiles", flowFiles.size());
 
-        final String hostname = context.getProperty(HOSTNAME).getValue();
-        final String shareName = context.getProperty(SHARE).getValue();
+        final FlowFile firstFlowFile = flowFiles.getFirst();
+        final String hostname = 
context.getProperty(HOSTNAME).evaluateAttributeExpressions(firstFlowFile).getValue();
+        final String shareName = 
context.getProperty(SHARE).evaluateAttributeExpressions(firstFlowFile).getValue();

Review Comment:
   Instead of evaluating against the first FlowFile, I recommend adding get 
methods on the `FlowFileFilter`.



-- 
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]

Reply via email to