org.apache.ftpserver
Class DefaultCommandFactory

java.lang.Object
  extended by org.apache.ftpserver.DefaultCommandFactory
All Implemented Interfaces:
CommandFactory

public class DefaultCommandFactory
extends java.lang.Object
implements CommandFactory

Command factory to return appropriate command implementation depending on the FTP request command string. Used a default setup of commands which can be appended or overriden using #setCommandMap(HashMap).


Constructor Summary
DefaultCommandFactory()
           
 
Method Summary
 Command getCommand(java.lang.String cmdName)
          Get command.
 java.util.Map<java.lang.String,Command> getCommandMap()
          Get the installed commands
 boolean isUseDefaultCommands()
          Are default commands used?
 void setCommandMap(java.util.Map<java.lang.String,Command> commandMap)
          Set commands to add or override to the default commands
 void setUseDefaultCommands(boolean useDefaultCommands)
          Sets whether the default commands will be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCommandFactory

public DefaultCommandFactory()
Method Detail

isUseDefaultCommands

public boolean isUseDefaultCommands()
Are default commands used?

Returns:
true if default commands are used

setUseDefaultCommands

public void setUseDefaultCommands(boolean useDefaultCommands)
Sets whether the default commands will be used.

Parameters:
useDefaultCommands - true if default commands should be used

getCommandMap

public java.util.Map<java.lang.String,Command> getCommandMap()
Get the installed commands

Returns:
The installed commands

setCommandMap

public void setCommandMap(java.util.Map<java.lang.String,Command> commandMap)
Set commands to add or override to the default commands

Parameters:
commandMap - The map of commands, the key will be used to map to requests.

getCommand

public Command getCommand(java.lang.String cmdName)
Get command. Returns null if not found.

Specified by:
getCommand in interface CommandFactory


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.