net.sf.hermesftp.cmd
Interface FtpCmd

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
AbstractFtpCmd, AbstractFtpCmdList, AbstractFtpCmdPasv, AbstractFtpCmdPort, AbstractFtpCmdRetr, AbstractFtpCmdStor, AbstractFtpCmdStorFile, FtpCmdAbor, FtpCmdAllo, FtpCmdAppe, FtpCmdAuth, FtpCmdCdup, FtpCmdClnt, FtpCmdCwd, FtpCmdDele, FtpCmdEprt, FtpCmdEpsv, FtpCmdFeat, FtpCmdHelp, FtpCmdList, FtpCmdMdtm, FtpCmdMkd, FtpCmdMode, FtpCmdNlst, FtpCmdNoop, FtpCmdNotImpl, FtpCmdOpts, FtpCmdPass, FtpCmdPasv, FtpCmdPbsz, FtpCmdPort, FtpCmdProt, FtpCmdPwd, FtpCmdQuit, FtpCmdRest, FtpCmdRetr, FtpCmdRmd, FtpCmdRnfr, FtpCmdRnto, FtpCmdSize, FtpCmdStat, FtpCmdStor, FtpCmdStou, FtpCmdStru, FtpCmdSyst, FtpCmdType, FtpCmdUser

public interface FtpCmd
extends java.lang.Cloneable

Interface of FTP Commands.

Author:
Lars Behnke

Method Summary
 void execute()
          Executes the command.
 java.lang.String getHelp()
          Returns a short help text for the command.
 java.lang.String getToken()
          Returns the command token.
 boolean handleAsyncCmd(java.lang.String req)
          Handles any request on the control connection that was sent while the current command is executed.
 boolean isAuthenticationRequired()
          Returns whether authentication is needed or not.
 void setArguments(java.lang.String args)
          Passes the optional command argument.
 void setCtx(FtpSessionContext ctx)
          Passes the FTP context shared by all command instances of a user FTP session.
 void setToken(java.lang.String token)
          Sets the command token.
 

Method Detail

setToken

void setToken(java.lang.String token)
Sets the command token.

Parameters:
token - The command token (e.g. STOR, RETR, ...)

getToken

java.lang.String getToken()
Returns the command token.

Returns:
The command token (e.g. STOR, RETR, ...)

setArguments

void setArguments(java.lang.String args)
Passes the optional command argument.

Parameters:
args - The arguments as text

setCtx

void setCtx(FtpSessionContext ctx)
Passes the FTP context shared by all command instances of a user FTP session.

Parameters:
ctx - The FTP context.

execute

void execute()
             throws FtpCmdException
Executes the command.

Throws:
FtpCmdException - Thrown on any exception occuring while the command is executed.

handleAsyncCmd

boolean handleAsyncCmd(java.lang.String req)
Handles any request on the control connection that was sent while the current command is executed. For instance, while storing or retrieving the client may issue an abort or status command.

Parameters:
req - The request that has to be handled.
Returns:
True is request was handled, otherwise false.

getHelp

java.lang.String getHelp()
Returns a short help text for the command.

Returns:
The help text.

isAuthenticationRequired

boolean isAuthenticationRequired()
Returns whether authentication is needed or not.

Returns:
True, if the command requires authentication.


Copyright © 2005-2007 Lars Behnke. All Rights Reserved.