// get data connection
session.write(LocalizedFtpReply.translate(session, request, context,
FtpReply.REPLY_150_FILE_STATUS_OKAY, "LIST", null));
DataConnection dataConnection;
try {
dataConnection = session.getDataConnection().openConnection();
} catch (Exception e) {
LOG.debug("Exception getting the output data stream", e);
session.write(LocalizedFtpReply.translate(session, request, context,
FtpReply.REPLY_425_CANT_OPEN_DATA_CONNECTION, "LIST",
null));
return;
}
// transfer listing data
boolean failure = false;
try {
// parse argument
ListArgument parsedArg = ListArgumentParser.parse(request
.getArgument());
dataConnection.transferToClient(session.getFtpletSession(), directoryLister.listFiles(
parsedArg, session.getFileSystemView(),
LIST_FILE_FORMATER));
} catch (SocketException ex) {
LOG.debug("Socket exception during list transfer", ex);
failure = true;