Retrieving a directy listing of a directory containing a large number of files is very slow.
The method SftpSubSystem.doReaddir() uses a fixed maximum packet size of the returned SSH_FXP_NAME packets of 16*1024 bytes. Defined by the constant DEFAULT_MAX_READDIR_DATA_SIZE. It is possible to override this constant by setting the property MAX_READDIR_DATA_SIZE_PROP for that session.
Would it not be better to dynamicly calculate the maximum SSH_FXP_NAME packet size based on MAX_PACKET_SIZE?