Retrieving a local directory listing |
To get a local directory listing of your current local directory use the Sftp#getLocalDirListing method. This returns an Enumeration of java.io.File objects.
Example
// get local directory listing Enumeration f = sftp.getLocalDirListing(); while(f.hasMoreElements()) { File file = (File)f.nextElement(); System.out.println(file.getName()); } |