commandName = FtpConst.Commands.CMD_PASV;
}
public void run(String[] params) throws IOException
{
FtpDataTransiver transiver =
clientSession().getFtpServer().getDataChannelManager().getDataTransiver(clientSession());
if (transiver == null)
{
reply(FtpConst.Replyes.REPLY_421_DATA);
return;
}
clientSession().setDataTransiver(transiver);
String serverLocation = clientSession().getServerIp();
serverLocation = serverLocation.replace('.', ',');
int dataPort = transiver.getDataPort();
int high = dataPort / 256;
int low = dataPort % 256;
serverLocation += String.format(",%s,%s", high, low);
reply(String.format(FtpConst.Replyes.REPLY_227, serverLocation));