return;
}
// check argument
arg = arg.toUpperCase();
ServerDataConnectionFactory dcon = session.getDataConnection();
if(arg.equals("C")) {
dcon.setSecure(false);
session.write(FtpReplyUtil.translate(session, request, context, FtpReply.REPLY_200_COMMAND_OKAY, "PROT", null));
}
else if(arg.equals("P")) {
if(session.getListener().getDataConnectionConfiguration().getSslConfiguration() == null) {
session.write(FtpReplyUtil.translate(session, request, context, 431, "PROT", null));
}
else {
dcon.setSecure(true);
session.write(FtpReplyUtil.translate(session, request, context, FtpReply.REPLY_200_COMMAND_OKAY, "PROT", null));
}
}
else {
session.write(FtpReplyUtil.translate(session, request, context, FtpReply.REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER, "PROT", null));