TODO: This is an unsafe list method since it uses ChannelSftp.ls(String) which loads the entire result in memory.
TODO: This is an unsafe list method since it uses ChannelSftp.ls(String) which loads the entire result in memory. A better approach would be to use ChannelSftp.ls(String, LsEntrySelector) and provide a function that is called with every LSEntry returned, this is how ChannelSftp.ls is defined:
public java.util.Vector ls(String path) throws SftpException{ final java.util.Vector v = new Vector(); LsEntrySelector selector = new LsEntrySelector(){ public int select(LsEntry entry){ v.addElement(entry); return CONTINUE; } }; ls(path, selector); return v; }
path to list
Stream[F, Path]