Manish Bansal created VFS-808:
---------------------------------

             Summary: SFTPFileObject getChildren taking forever for large 
number of files
                 Key: VFS-808
                 URL: https://issues.apache.org/jira/browse/VFS-808
             Project: Commons VFS
          Issue Type: Bug
    Affects Versions: 2.2
            Reporter: Manish Bansal


I need to list the files present in a folder on remote server. As of now, there 
are 27k (1KB) files present there. However, it is taking forever to get the 
result.

Sample code:

 
{code:java}
FileSystemOptions fsOptions = new FileSystemOptions();
StandardFileSystemManager fsManager = null;
// Initialize both fsOptions and fsmanager
FileObject remoteFile= fsManager.resolveFile(sourceURI, fsOptions);
FileObject[] allAckFiles = remoteFile.getChildren();
{code}
 

Further, i tried debugging it. Surprisingly, the response from ftp server only 
takes 90 seconds. Its the java loop present at [line 
|https://github.com/apache/commons-vfs/blob/master/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java#L329]which
 is taking forever to complete. Even after 5 minutes, its only able to traverse 
1000 FileObjects. Why is it so? 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to