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


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java:
##########
@@ -694,20 +708,12 @@ public FileInfo getRemoteFileInfo(final FlowFile 
flowFile, final String path, St
             }
         }
 
-        RemoteResourceInfo matchingEntry = null;
-        for (final RemoteResourceInfo entry : remoteResources) {
-            if (entry.getName().equalsIgnoreCase(filename)) {
-                matchingEntry = entry;
-                break;
-            }
-        }
-
         // Previously JSCH would perform a listing on the full path (path + 
filename) and would get an exception when it wasn't
         // a file and then return null, so to preserve that behavior we return 
null if the matchingEntry is a directory

Review Comment:
   Given the change in behavior, these comments should be removed.
   ```suggestion
   ```



##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java:
##########
@@ -340,7 +356,7 @@ protected void getListing(final String path, final int 
depth, final int maxResul
 
                 if (isIncludedFile(entry, symlink) && (filteringDisabled || 
pathMatched)) {
                     if (filteringDisabled || fileFilterPattern == null || 
fileFilterPattern.matcher(entryFilename).matches()) {
-                        listing.add(newFileInfo(entry, path));
+                        listing.add(newFileInfo(path, entry.getName(), 
entry.getAttributes()));

Review Comment:
   Regarding the second question, it appears that the behavior remains the 
same. Thanks for the helpful reply, this looks good.



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