LIST command on ftp

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

LIST command on ftp

antonela destito
I have a citrus ftpClient that connects to a citrus ftpServer (both defined in citrus context):

        ftpClient.getFtpClient().connect(ftpHostname, Integer.valueOf(ftpPort));
        ftpClient.getFtpClient().login(ftpUsername, ftpPassword);
        ftpClient.send(new FtpMessage(FTPCmd.EPRT, "|1||22|"), context);
        ftpClient.send(new FtpMessage(FTPCmd.CWD, ftpDir), context);
        ftpClient.send(new FtpMessage(FTPCmd.LIST, null), context);
        Message response = ftpClient.receive(context);

Here, the connection is successful. and the reply is; SENT: 150 File status okay; about to open data connection.

In the citrus console, i see the files that are in the server, but they are not in the response Message object; when can i find the list?

Thanks in advanced,
Reply | Threaded
Open this post in threaded view

Re: LIST command on ftp

Christoph Deppisch
Ftp client responses are cached and queued so you are actually receiving the response for the first send operation. Please add a receive after each send operation to make sure that no queued responses are on the ftp client component.