public class RetrCommandHandler extends AbstractStubDataCommandHandler implements CommandHandler
fileContents
property,
specified either as a String or as a byte array.
Each invocation record stored by this CommandHandler includes the following data element key/values:
PATHNAME_KEY
("pathname") - the pathname of the file submitted on the invocation (the first command parameter)
Modifier and Type | Field and Description |
---|---|
static String |
PATHNAME_KEY |
finalReplyCode, finalReplyMessageKey, finalReplyText, preliminaryReplyCode, preliminaryReplyMessageKey, preliminaryReplyText
LOG
Constructor and Description |
---|
RetrCommandHandler()
Create new uninitialized instance
|
RetrCommandHandler(byte[] fileContents)
Create new instance using the specified fileContents
|
RetrCommandHandler(String fileContents)
Create new instance using the specified fileContents
|
Modifier and Type | Method and Description |
---|---|
protected void |
beforeProcessData(Command command,
Session session,
InvocationRecord invocationRecord)
Perform any necessary logic before transferring data across the data connection.
|
protected void |
processData(Command command,
Session session,
InvocationRecord invocationRecord)
Abstract method placeholder for subclass transfer of data across the data connection.
|
void |
setFileContents(byte[] fileContents)
Set the file contents to return from subsequent command invocations
|
void |
setFileContents(String fileContents)
Set the file contents to return from subsequent command invocations
|
afterProcessData, handleCommand, sendFinalReply, setFinalReplyCode, setFinalReplyMessageKey, setFinalReplyText, setPreliminaryReplyCode, setPreliminaryReplyMessageKey, setPreliminaryReplyText
clearInvocations, getInvocation, handleCommand, numberOfInvocations, sendReply
assertValidReplyCode, getReplyTextBundle, quotes, setReplyTextBundle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleCommand
public static final String PATHNAME_KEY
public RetrCommandHandler()
public RetrCommandHandler(String fileContents)
fileContents
- - the file contentsAssertFailedException
- - if the fileContents is nullpublic RetrCommandHandler(byte[] fileContents)
fileContents
- - the file contentsAssertFailedException
- - if the fileContents is nullprotected void beforeProcessData(Command command, Session session, InvocationRecord invocationRecord) throws Exception
AbstractStubDataCommandHandler
beforeProcessData
in class AbstractStubDataCommandHandler
command
- - the Command to be handledsession
- - the session on which the Command was submittedinvocationRecord
- - the InvocationRecord; CommandHandlers are expected to add
handler-specific data to the InvocationRecord, as appropriateException
- - if an error occursAbstractStubDataCommandHandler.beforeProcessData(org.mockftpserver.core.command.Command, org.mockftpserver.core.session.Session, org.mockftpserver.core.command.InvocationRecord)
protected void processData(Command command, Session session, InvocationRecord invocationRecord)
AbstractStubDataCommandHandler
processData
in class AbstractStubDataCommandHandler
command
- - the Command to be handledsession
- - the session on which the Command was submittedinvocationRecord
- - the InvocationRecord; CommandHandlers are expected to add
handler-specific data to the InvocationRecord, as appropriateAbstractStubDataCommandHandler.processData(org.mockftpserver.core.command.Command, org.mockftpserver.core.session.Session, org.mockftpserver.core.command.InvocationRecord)
public void setFileContents(String fileContents)
fileContents
- - the fileContents to setAssertFailedException
- - if the fileContents is nullpublic void setFileContents(byte[] fileContents)
fileContents
- - the file contentsAssertFailedException
- - if the fileContents is nullCopyright © 2016. All rights reserved.