I am using Apache FTPClient for getting files and sub-directory files listing. But it cant get listing of files from directory name with spaces. Here is an example - I tried it with two different directories:
FTPClient client = new org.apache.commons.net.ftp.FTPClient();
client.connect("ftp.domain.com");
client.login("userid", "password");
FTPFile[] names = client.listDirectories("ABC XYZ"); //Empty array
FTPFile[] names2 = client.listDirectories("ABCXYZ"); //working
So directory name with spaces not returning anything. I tried to put "%20" and "+" at the place of space. Also I tried "\"ABC XYZ\"". But still is not working. Am I missing anything.
ABC XYZ
exists where you're looking for it? – HaddockABC XYZ
contain any subdirectories? That's what you're asking for here. Maybe you meant to uselistFiles()
? – HaddockFTPFileEntryParser
implementation to be used. Take a look atFTPClientConfig
andFTPClient#setParserFactory()
. – Haddock