Apache FTPSCleint.listFiles() returns empty array

1.1k views Asked by At

I'm trying to get files from ftp server with no luck. commons-net version 3.5

            FTPSClient ftpClient = new FTPSClient();
            ftpClient.connect("xxx.com", 21);
            ftpClient.enterLocalPassiveMode();
            ftpClient.login("login", "password");
            ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
            FTPClientConfig conf = new FTPClientConfig();
//            conf.setUnparseableEntries(true);
            conf.setServerTimeZoneId("UTC");
            ftpClient.configure(conf);
            ftpClient.execPBSZ(0);
            ftpClient.execPROT("P");
            return ftpClient;

Only after I uncommented conf.setUnparseableEntries(true) I got array of "something". isFile() method returns false so I can't use File's methods with it. All of them throws NullPointerException.

Any advise where is the problem and why Apache can't parse files?

Added ftp log:

220 
AUTH TLS
234 AUTH command ok. Expecting TLS Negotiation.
USER *******
331 Password required
PASS *******
230 User logged in.
TYPE I
200 Type set to I.
PBSZ 0
200 PBSZ command successful.
PROT P
200 PROT command successful.
PASV
227 Entering Passive Mode (10,200,2,87,252,174).
LIST /INCOME
125 Data connection already open; Transfer starting.
226 Transfer complete.
QUIT
221 Goodbye.
0

There are 0 answers