Apache Commons FTPClient.listFiles
I am using org.apache.commons.net.ftp.FTPClient in one of my applications to work with a FTP server. I am able to connect , login , pwd and cwd . However, when I try to list the files it doesn't return the list of files in that directory, where I know for sure that there are files. I am using the method FTPFile[] listFiles() , it returns an empty array of FTPFile . Please find below the code snippet where I am trying this: String hostname = properties.getProperty("FTP_SERVER"); String user = properties.getProperty("FTP_USER"); String passwd = properties.getProperty("FTP_PASSWD"); FTPClient