org.mockftpserver.fake.command
Class RetrCommandHandler
java.lang.Object
org.mockftpserver.core.command.AbstractCommandHandler
org.mockftpserver.fake.command.AbstractFakeCommandHandler
org.mockftpserver.fake.command.RetrCommandHandler
- All Implemented Interfaces:
- CommandHandler, ReplyTextBundleAware, ServerConfigurationAware
public class RetrCommandHandler
- extends AbstractFakeCommandHandler
CommandHandler for the RETR command. Handler logic:
- If the user has not logged in, then reply with 530 and terminate
- If the required pathname parameter is missing, then reply with 501 and terminate
- If the pathname parameter does not specify a valid, existing filename, then reply with 550 and terminate
- If the current user does not have read access to the file at the specified path or execute permission to its directory, then reply with 550 and terminate
- Send an initial reply of 150
- Send the contents of the named file across the data connection
- If there is an error reading the file, then reply with 550 and terminate
- Send a final reply with 226
- Version:
- $Revision: 214 $ - $Date: 2008-12-26 20:00:19 -0500 (Fri, 26 Dec 2008) $
- Author:
- Chris Mair
|
Method Summary |
protected byte[] |
convertLfToCrLf(byte[] bytes)
Within the specified byte array, replace all LF (\n) that are NOT preceded by a CR (\r) into CRLF (\r\n). |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RetrCommandHandler
public RetrCommandHandler()
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 handledsession - - the session on which the Command was submitted
convertLfToCrLf
protected byte[] convertLfToCrLf(byte[] bytes)
- Within the specified byte array, replace all LF (\n) that are NOT preceded by a CR (\r) into CRLF (\r\n).
- Parameters:
bytes - - the bytes to be converted
- Returns:
- the result of converting LF to CRLF
Copyright © 2014. All rights reserved.