ArrayList list = new ArrayList();
int result = sftp.listChildren(locdir, list);
log.debug("Directory contents retrieved."+result+" elements ("+list.size()+")");
will give me only the first 100 results in my directory.
I'm using the OpenSSH server, and doing a "ls" from a console client (Putty), gives me the correct list (more than 1000 entries).
Is this a known issue? Is there any configuration parameter to handle this? Is this a bug? I'm a bit lost.
Thanks!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
the following piece of code:
ArrayList list = new ArrayList();
int result = sftp.listChildren(locdir, list);
log.debug("Directory contents retrieved."+result+" elements ("+list.size()+")");
will give me only the first 100 results in my directory.
I'm using the OpenSSH server, and doing a "ls" from a console client (Putty), gives me the correct list (more than 1000 entries).
Is this a known issue? Is there any configuration parameter to handle this? Is this a bug? I'm a bit lost.
Thanks!!
Your using the method incorrectly.
You should call listChildren multiple times untill it returns -1 to indicate that no more files are available to be listed.
Have you tried using the SftpClient instead? Its a much more simpler interface and would only require one call to ls.