org.mockftpserver.fake.command
Class RntoCommandHandler

java.lang.Object
  extended by org.mockftpserver.core.command.AbstractCommandHandler
      extended by org.mockftpserver.fake.command.AbstractFakeCommandHandler
          extended by org.mockftpserver.fake.command.RntoCommandHandler
All Implemented Interfaces:
CommandHandler, ReplyTextBundleAware, ServerConfigurationAware

public class RntoCommandHandler
extends AbstractFakeCommandHandler

CommandHandler for the RNTO command. Handler logic:

  1. If the user has not logged in, then reply with 530
  2. If this command was not preceded by a valid RNFR command, then reply with 503
  3. If the required TO pathname parameter is missing, then reply with 501
  4. If the TO pathname parameter does not specify a valid filename, then reply with 553
  5. If the TO pathname parameter specifies an existing directory, then reply with 553
  6. If the current user does not have write access to the parent directory, then reply with 553
  7. Otherwise, rename the file, remove the FROM path stored in the session by the RNFR command, and reply with 250
The supplied pathname may be absolute or relative to the current directory.

Version:
$Revision: 221 $ - $Date: 2009-02-08 21:48:12 -0500 (Sun, 08 Feb 2009) $
Author:
Chris Mair

Field Summary
 
Fields inherited from class org.mockftpserver.fake.command.AbstractFakeCommandHandler
INTERNAL_ERROR_KEY, replyCodeForFileSystemException
 
Fields inherited from class org.mockftpserver.core.command.AbstractCommandHandler
LOG
 
Constructor Summary
RntoCommandHandler()
           
 
Method Summary
protected  void handle(Command command, Session session)
          Handle the specified command for the session.
 
Methods inherited from class org.mockftpserver.fake.command.AbstractFakeCommandHandler
defaultIfNullOrEmpty, endOfLine, getFileSystem, getRealPath, getRequiredSessionAttribute, getServerConfiguration, getUserAccount, handleCommand, list, list, login, notNullOrEmpty, sendReply, sendReply, sendReply, sendReply, setServerConfiguration, validateUserAccount, verifyExecutePermission, verifyFileSystemCondition, verifyLoggedIn, verifyReadPermission, verifyWritePermission
 
Methods inherited from class org.mockftpserver.core.command.AbstractCommandHandler
assertValidReplyCode, getReplyTextBundle, quotes, setReplyTextBundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RntoCommandHandler

public RntoCommandHandler()
Method Detail

handle

protected void handle(Command command,
                      Session session)
Description copied from class: AbstractFakeCommandHandler
Handle the specified command for the session. All checked exceptions are expected to be wrapped or handled by the caller.

Specified by:
handle in class AbstractFakeCommandHandler
Parameters:
command - - the Command to be handled
session - - the session on which the Command was submitted


Copyright © 2014. All rights reserved.