Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/3000#discussion_r218842524
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/FTPTransfer.java
 ---
    @@ -263,6 +265,16 @@ public String getHomeDirectory(final FlowFile 
flowFile) throws IOException {
                     }
                 }
     
    +            // if is a link and we're supposed to follow symlink
    +            if (symlink && file.isSymbolicLink()) {
    +                try {
    +                    listing.addAll(getListing(newFullForwardPath, depth + 
1, maxResults - count));
    +                } catch (final IOException e) {
    +                    logger.error("Unable to get listing from " + 
newFullForwardPath + "; skipping this symlink", e);
    +                }
    +            }
    +
    +
    --- End diff --
    
    Wondering if it'd be better to avoid code duplication.
    
    ````java
                if ((recurse && file.isDirectory()) || (symlink && 
file.isSymbolicLink())) {
                    try {
                        listing.addAll(getListing(newFullForwardPath, depth + 
1, maxResults - count));
                     } catch (final IOException e) {
                         logger.error("Unable to get listing from " + 
newFullForwardPath + "; skipping", e);
                    }
                }
    ````


---

Reply via email to