I am using apache-commons-net 3.4 and i found a strange issue i cant explain. I want to get the FTPFile
entries of an directory but when i use FTPClient#listFiles()
an empty array is returned, but FTPClient#listNames()
list all entries.
FTPClient client = new FTPClient();
client.connect("192.168.1.4");
client.enterLocalPassiveMode();
client.login("ftpuser", "ftpuser");
System.out.println( client.listFiles("/").length); // prints 0
System.out.println( client.listNames("/").length); // prints 21
What is going on here how to use listFiles()
correct ?
Related questions that didn't answer my question: