public class UserCommandHandler extends AbstractStubCommandHandler implements CommandHandler
passwordRequired
property defaults to true,
indicating that a password is required following the user name. If true, this command handler
returns a reply of 331. If false, return a reply of 230.
Each invocation record stored by this CommandHandler includes the following data element key/values:
USERNAME_KEY
("username") - the user name submitted on the invocation (the first command parameter)
Modifier and Type | Field and Description |
---|---|
static String |
USERNAME_KEY |
replyCode, replyMessageKey, replyText
LOG
Constructor and Description |
---|
UserCommandHandler()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
handleCommand(Command command,
Session session,
InvocationRecord invocationRecord)
Handle the specified command for the session.
|
boolean |
isPasswordRequired()
Return true if a password is required at login.
|
void |
setPasswordRequired(boolean passwordRequired)
Set true to indicate that a password is required.
|
sendReply, sendReply, setReplyCode, setReplyMessageKey, setReplyText
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 USERNAME_KEY
public void handleCommand(Command command, Session session, InvocationRecord invocationRecord)
AbstractTrackingCommandHandler
handleCommand
in class AbstractTrackingCommandHandler
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 appropriateCommandHandler.handleCommand(org.mockftpserver.core.command.Command, org.mockftpserver.core.session.Session)
public boolean isPasswordRequired()
setPasswordRequired(boolean)
.public void setPasswordRequired(boolean passwordRequired)
passwordRequired
- - is a password required for loginCopyright © 2016. All rights reserved.