I'm using apache.commons.net
ftpClient
but I'm facing a problem that I'm not sure how to fix.
So basically I log in the server, set the passive mode, and then I run:
fileFTPFiles = this.ftpClient.listFiles(strPath);
In all the servers I have connected to until today, this worked like a charm but today I connected to a server that instead of returning the file or the files in the give path always returns the landing directory files...
Although if I run
fileFTPFiles = this.ftpClient.mlistDir(strPath);
it returns what I expect.
Can anyone explain me why this happens and if there is a easy way to detect whether to use listFile
or mlistFiles
?