org.mockftpserver.core.command
Class AbstractCommandHandler

java.lang.Object
  extended by org.mockftpserver.core.command.AbstractCommandHandler
All Implemented Interfaces:
CommandHandler, ReplyTextBundleAware
Direct Known Subclasses:
AbstractFakeCommandHandler, AbstractTrackingCommandHandler

public abstract class AbstractCommandHandler
extends Object
implements CommandHandler, ReplyTextBundleAware

The abstract superclass for CommandHandler classes.

Version:
$Revision: 264 $ - $Date: 2012-07-17 21:19:23 -0400 (Tue, 17 Jul 2012) $
Author:
Chris Mair

Field Summary
protected  org.slf4j.Logger LOG
           
 
Constructor Summary
AbstractCommandHandler()
           
 
Method Summary
protected  void assertValidReplyCode(int replyCode)
          Assert that the specified number is a valid reply code
 ResourceBundle getReplyTextBundle()
          Return the ResourceBundle containing the reply text messages
protected static String quotes(String text)
          Return the specified text surrounded with double quotes
 void setReplyTextBundle(ResourceBundle replyTextBundle)
          Set the ResourceBundle containing the reply text messages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mockftpserver.core.command.CommandHandler
handleCommand
 

Field Detail

LOG

protected final org.slf4j.Logger LOG
Constructor Detail

AbstractCommandHandler

public AbstractCommandHandler()
Method Detail

getReplyTextBundle

public ResourceBundle getReplyTextBundle()
Return the ResourceBundle containing the reply text messages

Specified by:
getReplyTextBundle in interface ReplyTextBundleAware
Returns:
the replyTextBundle
See Also:
ReplyTextBundleAware.getReplyTextBundle()

setReplyTextBundle

public void setReplyTextBundle(ResourceBundle replyTextBundle)
Set the ResourceBundle containing the reply text messages

Specified by:
setReplyTextBundle in interface ReplyTextBundleAware
Parameters:
replyTextBundle - - the replyTextBundle to set
See Also:
ReplyTextBundleAware.setReplyTextBundle(java.util.ResourceBundle)

quotes

protected static String quotes(String text)
Return the specified text surrounded with double quotes

Parameters:
text - - the text to surround with quotes
Returns:
the text with leading and trailing double quotes
Throws:
AssertFailedException - - if text is null

assertValidReplyCode

protected void assertValidReplyCode(int replyCode)
Assert that the specified number is a valid reply code

Parameters:
replyCode - - the reply code to check
Throws:
AssertFailedException - - if the replyCode is invalid


Copyright © 2014. All rights reserved.