|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ftpserver.BaseFtpConnection
org.apache.ftpserver.FtpConnection
public class FtpConnection
This class handles each ftp connection. Here all the ftp command
methods take two arguments - a ftp request and a writer object.
This is the main backbone of the ftp server.
The ftp command method signature is:
public void doXYZ(FtpRequest request, FtpWriter out) throws IOException
.
Here XYZ
is the capitalized ftp command.
Field Summary |
---|
Fields inherited from class org.apache.ftpserver.BaseFtpConnection |
---|
mbStopRequest, mConfig, mControlSocket, mDataConnection, METHOD_INPUT_SIG, mFtpStatus, mObserver, mSpy, mUser, mWriter |
Constructor Summary | |
---|---|
FtpConnection(FtpConfig cfg)
Set configuration file and the control socket. |
Method Summary | |
---|---|
void |
doABOR(FtpRequest request,
FtpWriter out)
ABOR <CRLF> This command tells the server to abort the previous FTP service command and any associated transfer of data. |
void |
doAPPE(FtpRequest request,
FtpWriter out)
APPE <SP> <pathname> <CRLF> This command causes the server-DTP to accept the data transferred via the data connection and to store the data in a file at the server site. |
void |
doCDUP(FtpRequest request,
FtpWriter out)
CDUP <CRLF> This command is a special case of CWD, and is included to simplify the implementation of programs for transferring directory trees between operating systems having different syntaxes for naming the parent directory. |
void |
doCWD(FtpRequest request,
FtpWriter out)
CWD <SP> <pathname> <CRLF> This command allows the user to work with a different directory for file storage or retrieval without altering his login or accounting information. |
void |
doDELE(FtpRequest request,
FtpWriter out)
DELE <SP> <pathname> <CRLF> This command causes the file specified in the pathname to be deleted at the server site. |
void |
doHELP(FtpRequest request,
FtpWriter out)
HELP [<SP> This command shall cause the server to send helpful information regarding its implementation status over the control connection to the user. |
void |
doLIST(FtpRequest request,
FtpWriter out)
LIST [<SP> <pathname>] <CRLF> This command causes a list to be sent from the server to the passive DTP. |
void |
doMDTM(FtpRequest request,
FtpWriter out)
MDTM <SP> <pathname> <CRLF> Returns the date and time of when a file was modified. |
void |
doMKD(FtpRequest request,
FtpWriter out)
MKD <SP> <pathname> <CRLF> This command causes the directory specified in the pathname to be created as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative). |
void |
doMODE(FtpRequest request,
FtpWriter out)
MODE <SP> The argument is a single Telnet character code specifying the data transfer modes described in the Section on Transmission Modes. |
void |
doNLST(FtpRequest request,
FtpWriter out)
NLST [<SP> <pathname>] <CRLF> This command causes a directory listing to be sent from server to user site. |
void |
doNOOP(FtpRequest request,
FtpWriter out)
NOOP <CRLF> This command does not affect any parameters or previously entered commands. |
void |
doPASS(FtpRequest request,
FtpWriter out)
PASS <SP> The argument field is a Telnet string specifying the user's password. |
void |
doPASV(FtpRequest request,
FtpWriter out)
PASV <CRLF> This command requests the server-DTP to "listen" on a data port (which is not its default data port) and to wait for a connection rather than initiate one upon receipt of a transfer command. |
void |
doPORT(FtpRequest request,
FtpWriter out)
PORT <SP> The argument is a HOST-PORT specification for the data port to be used in data connection. |
void |
doPWD(FtpRequest request,
FtpWriter out)
PWD <CRLF> This command causes the name of the current working directory to be returned in the reply. |
void |
doQUIT(FtpRequest request,
FtpWriter out)
QUIT <CRLF> This command terminates a USER and if file transfer is not in progress, the server closes the control connection. |
void |
doREST(FtpRequest request,
FtpWriter out)
REST <SP> The argument field represents the server marker at which file transfer is to be restarted. |
void |
doRETR(FtpRequest request,
FtpWriter out)
RETR <SP> <pathname> <CRLF> This command causes the server-DTP to transfer a copy of the file, specified in the pathname, to the server- or user-DTP at the other end of the data connection. |
void |
doRMD(FtpRequest request,
FtpWriter out)
RMD <SP> <pathname> <CRLF> This command causes the directory specified in the pathname to be removed as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative). |
void |
doRNFR(FtpRequest request,
FtpWriter out)
RNFR <SP> <pathname> <CRLF> This command specifies the old pathname of the file which is to be renamed. |
void |
doRNTO(FtpRequest request,
FtpWriter out)
RNTO <SP> <pathname> <CRLF> This command specifies the new pathname of the file specified in the immediately preceding "rename from" command. |
void |
doSITE(FtpRequest request,
FtpWriter out)
SITE <SP> This command is used by the server to provide services specific to his system that are essential to file transfer but not sufficiently universal to be included as commands in the protocol. |
void |
doSIZE(FtpRequest request,
FtpWriter out)
SIZE <SP> <pathname> <CRLF> Returns the size of the file in bytes. |
void |
doSTAT(FtpRequest request,
FtpWriter out)
STAT [<SP> <pathname>] <CRLF> This command shall cause a status response to be sent over the control connection in the form of a reply. |
void |
doSTOR(FtpRequest request,
FtpWriter out)
STOR <SP> <pathname> <CRLF> This command causes the server-DTP to accept the data transferred via the data connection and to store the data as a file at the server site. |
void |
doSTOU(FtpRequest request,
FtpWriter out)
STOU <CRLF> This command behaves like STOR except that the resultant file is to be created in the current directory under a name unique to that directory. |
void |
doSTRU(FtpRequest request,
FtpWriter out)
STRU <SP> <structure-code> <CRLF> The argument is a single Telnet character code specifying file structure. |
void |
doSYST(FtpRequest request,
FtpWriter out)
SYST <CRLF> This command is used to find out the type of operating system at the server. |
void |
doTYPE(FtpRequest request,
FtpWriter out)
TYPE <SP> <type-code> <CRLF> The argument specifies the representation type. |
void |
doUSER(FtpRequest request,
FtpWriter out)
USER <SP> <username> <CRLF> The argument field is a Telnet string identifying the user. |
protected boolean |
hasPermission(FtpRequest request)
Check the user permission to execute this command. |
Methods inherited from class org.apache.ftpserver.BaseFtpConnection |
---|
dataTransferred, getConfig, getObserver, getSpyObject, getStatus, getUser, handleConnection, isClosed, notifyObserver, service, setObserver, setSpyObject, spyRequest, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FtpConnection(FtpConfig cfg)
Method Detail |
---|
protected boolean hasPermission(FtpRequest request)
hasPermission
in class BaseFtpConnection
public void doABOR(FtpRequest request, FtpWriter out) throws IOException
ABOR <CRLF>
IOException
public void doAPPE(FtpRequest request, FtpWriter out) throws IOException
APPE <SP> <pathname> <CRLF>
IOException
public void doCDUP(FtpRequest request, FtpWriter out) throws IOException
CDUP <CRLF>
IOException
public void doCWD(FtpRequest request, FtpWriter out) throws IOException
CWD <SP> <pathname> <CRLF>
IOException
public void doDELE(FtpRequest request, FtpWriter out) throws IOException
DELE <SP> <pathname> <CRLF>
IOException
public void doHELP(FtpRequest request, FtpWriter out) throws IOException
HELP [<SP> ] <CRLF>
IOException
public void doLIST(FtpRequest request, FtpWriter out) throws IOException
LIST [<SP> <pathname>] <CRLF>
IOException
public void doMDTM(FtpRequest request, FtpWriter out) throws IOException
MDTM <SP> <pathname> <CRLF>
IOException
public void doMKD(FtpRequest request, FtpWriter out) throws IOException
MKD <SP> <pathname> <CRLF>
IOException
public void doMODE(FtpRequest request, FtpWriter out) throws IOException
MODE <SP> <CRLF>
IOException
public void doNLST(FtpRequest request, FtpWriter out) throws IOException
NLST [<SP> <pathname>] <CRLF>
IOException
public void doNOOP(FtpRequest request, FtpWriter out) throws IOException
NOOP <CRLF>
IOException
public void doPASS(FtpRequest request, FtpWriter out) throws IOException
PASS <SP> <CRLF>
IOException
public void doPASV(FtpRequest request, FtpWriter out) throws IOException
PASV <CRLF>
IOException
public void doPORT(FtpRequest request, FtpWriter out) throws IOException
PORT <SP> <CRLF>
IOException
public void doPWD(FtpRequest request, FtpWriter out) throws IOException
PWD <CRLF>
IOException
public void doQUIT(FtpRequest request, FtpWriter out) throws IOException
QUIT <CRLF>
IOException
public void doREST(FtpRequest request, FtpWriter out) throws IOException
REST <SP> <CRLF>
IOException
public void doRETR(FtpRequest request, FtpWriter out) throws IOException
RETR <SP> <pathname> <CRLF>
IOException
public void doRMD(FtpRequest request, FtpWriter out) throws IOException
RMD <SP> <pathname> <CRLF>
IOException
public void doRNFR(FtpRequest request, FtpWriter out) throws IOException
RNFR <SP> <pathname> <CRLF>
IOException
public void doRNTO(FtpRequest request, FtpWriter out) throws IOException
RNTO <SP> <pathname> <CRLF>
IOException
public void doSITE(FtpRequest request, FtpWriter out) throws IOException
SITE <SP> <CRLF>
IOException
public void doSIZE(FtpRequest request, FtpWriter out) throws IOException
SIZE <SP> <pathname> <CRLF>
IOException
public void doSTAT(FtpRequest request, FtpWriter out) throws IOException
STAT [<SP> <pathname>] <CRLF>
IOException
public void doSTOR(FtpRequest request, FtpWriter out) throws IOException
STOR <SP> <pathname> <CRLF>
IOException
public void doSTOU(FtpRequest request, FtpWriter out) throws IOException
STOU <CRLF>
IOException
public void doSTRU(FtpRequest request, FtpWriter out) throws IOException
STRU <SP> <structure-code> <CRLF>
IOException
public void doSYST(FtpRequest request, FtpWriter out) throws IOException
SYST <CRLF>
IOException
public void doTYPE(FtpRequest request, FtpWriter out) throws IOException
TYPE <SP> <type-code> <CRLF>
IOException
public void doUSER(FtpRequest request, FtpWriter out) throws IOException
USER <SP> <username> <CRLF>
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |