[ 
https://issues.apache.org/jira/browse/NIFI-5560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16620734#comment-16620734
 ] 

ASF GitHub Bot commented on NIFI-5560:
--------------------------------------

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

    https://github.com/apache/nifi/pull/3000#discussion_r218843724
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java
 ---
    @@ -236,6 +238,12 @@ public int select(final LsEntry entry) {
                             return LsEntrySelector.CONTINUE;
                         }
     
    +                    // if is a link and we're supposed to follow symlink
    +                    if (symlink && entry.getAttrs().isLink()) {
    +                        links.add(entry);
    +                        return LsEntrySelector.CONTINUE;
    +                    }
    +
    --- End diff --
    
    Same as before, wondering if it'd be better to avoid code duplication:
    ````java
                        if ( (recurse && entry.getAttrs().isDir()) || (symlink 
&& entry.getAttrs().isLink()) ) {
                             subDirs.add(entry);
                            return LsEntrySelector.CONTINUE;
                        }
    ````


> Sub directory(symbolic link to directory) files are not getting listed in 
> ListSFTP(ListSFTP does not Follow symbolic links)
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-5560
>                 URL: https://issues.apache.org/jira/browse/NIFI-5560
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.7.1
>            Reporter: Hemantha kumara M S
>            Assignee: Hemantha kumara M S
>            Priority: Major
>
> *Here is the configuration*
> ----
> *SFTP Server side:*
> -bash-4.2$ mkdir -p /tmp/testData
>  -bash-4.2$
>  -bash-4.2$ mkdir -p /tmp/toRead
>  -bash-4.2$ ln -s /tmp/testData /tmp/toRead/data1
>  -bash-4.2$ touch /tmp/testData/1.txt
>  -bash-4.2$ touch /tmp/testData/2.txt
>  -bash-4.2$ touch /tmp/toRead/t.txt
> -bash-4.2$ mkdir /tmp/toRead/data2
> -bash-4.2$ touch /tmp/toRead/data2/22.txt
> -bash-4.2$ cd /tmp/toRead/
> -bash-4.2$ tree
> .
> ├── data1 -> /tmp/testData
> ├── data2
> │   └── 22.txt
> └── t.txt
> 2 directories, 2 files
> -bash-4.2$ pwd
> /tmp/toRead
> -bash-4.2$ tree
> .
> ├── data1 -> /tmp/testData
> ├── data2
> │   └── 22.txt
> └── t.txt
> 2 directories, 2 files
> -bash-4.2$ touch data
> data1/ data2/
> -bash-4.2$ touch data2/22.txt
> -bash-4.2$ touch t.txt
> -bash-4.2$ tree /tmp/testData
> /tmp/testData
> ├── 1.txt
> └── 2.txt
> 0 directories, 2 files
>  
> *Nifi:*
> Configured ListSFTP  +Remote Path+ to +/tmp/toRead/+ and +Search Recursively+ 
> to +true+
>   
> *+Expected result:+*
> Should list 4 files(1.txt, 2.txt, t.txt, data2/22.txt)
> *+Actual result:+*
> listed only two files(t.txt, data2/22.txt)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to