org.mockftpserver.fake.command
Class StouCommandHandler
java.lang.Object
org.mockftpserver.core.command.AbstractCommandHandler
org.mockftpserver.fake.command.AbstractFakeCommandHandler
org.mockftpserver.fake.command.AbstractStoreFileCommandHandler
org.mockftpserver.fake.command.StouCommandHandler
- All Implemented Interfaces:
- CommandHandler, ReplyTextBundleAware, ServerConfigurationAware
public class StouCommandHandler
- extends AbstractStoreFileCommandHandler
CommandHandler for the STOU command. Handler logic:
- If the user has not logged in, then reply with 530 and terminate
- Create new unique filename within the current directory
- If the current user does not have write access to the named file, if it already exists, or else to its
parent directory, then reply with 553 and terminate
- If the current user does not have execute access to the parent directory, then reply with 553 and terminate
- Send an initial reply of 150
- Read all available bytes from the data connection and write out to the unique file in the server file system
- If file write/store fails, then reply with 553 and terminate
- Send a final reply with 226, along with the new unique filename
- Version:
- $Revision: 201 $ - $Date: 2008-12-11 19:39:48 -0500 (Thu, 11 Dec 2008) $
- Author:
- Chris Mair
| 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StouCommandHandler
public StouCommandHandler()
getMessageKey
protected String getMessageKey()
- Specified by:
getMessageKey in class AbstractStoreFileCommandHandler
- Returns:
- the message key for the reply message sent with the final (226) reply
getOutputFile
protected String getOutputFile(Command command)
- Return the path (absolute or relative) for the output file.
- Overrides:
getOutputFile in class AbstractStoreFileCommandHandler
- Parameters:
command - - the Command
- Returns:
- the output file name
Copyright © 2014. All rights reserved.