public void messageReceived( final FtpIoSession session, final FtpRequest request ) throws Exception {
try {
String commandName = request.getCommand();
CommandFactory commandFactory = context.getCommandFactory();
Command command = commandFactory.getCommand(commandName);
if(command != null) {
synchronized (session) {
command.execute(session, context, request);
}
}
else {
session.write(FtpReplyUtil.translate(session, request, context, FtpReply.REPLY_502_COMMAND_NOT_IMPLEMENTED, "not.implemented", null));
}