Speed ​​up recursive FTP file enumerations

I have an Android app that lists the folders and files of an FTP directory . I am using Apache Commons FTP Client . It comes down to this line, which I call for each folder

FTPFile[] folderElements = ftpClient.listFiles(folderName); 

It works fine, but very laborious. The whole task (getting all the files and folders) takes about a minute. Can I speed it up somehow?

I have already tried

 ftpClient.setBufferSize(1024000); 
+7
java android ftp apache-commons-net
source share
1 answer

My project could be help. https://github.com/Honwhy/commons-pool-ftp (see ftpcp branch)

 FTPCPManager ftpCPManager = new FTPCPManager(); ftpCPManager.setUrl("ftp://127.0.0.1"); ftpCPManager.setUsername("sa"); ftpCPManager.setPassword("sa"); ftpCPManager.setKeepAliveTimeout(1 * 60); ftpCPManager.setConnectTimeout(1 * 1000); ftpCPManager.setMaxWait(1 * 1000); CommonFAOSupport support = new CommonFAOSupport(ftpCPManager); support.downloadDirectory("/apps/data/ftp/download", 4000, 10, processService); //10 thread 
+2
source share

All Articles