public enum FtpCommandCode extends Enum<FtpCommandCode>
Enum Constant and Description |
---|
ABOR
This command tells the server to abort the previous FTP service command
and
any associated transfer of
data.
|
ACCT
The argument field is a Telnet string identifying the user's account.
|
ALLO
This command may be required by some servers to reserve sufficient
storage
to accommodate the new file to
be transferred.
|
APPE
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.
|
AUTH
Security Association Setup AUTH TLS (Control) or AUTH SSL (Control and
Data)
234* 502, 504, 534*, 431* 500, 501, 421 AUTH TLS -> 234 -> USER or ([PBSZ 0] PROT P then USER) -> 2xy |
CCC
Security Association Setup
CCC (Control SSL Off) 200 500, 533*, 534* |
CDUP
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.
|
Connection
Command to simulate the beginning of a connection in order to force the
authentication step.
|
CWD
This command allows the user to work with a different directory or
dataset
for file storage or retrieval
without altering his login or accounting information.
|
DELE
This command causes the file specified in the pathname to be deleted at
the
server site.
|
EPRT
The EPRT command allows for the specification of an extended address for
the data connection.
|
EPSV
The EPSV command requests that a server listen on a data port and wait
for
a connection.
|
FEAT
The FEAT command consists solely of the word "FEAT".
|
HELP
This command shall cause the server to send helpful information
regarding
its implementation status over
the control connection to the user.
|
IncorrectSequence
Bad sequence of commands
Always return 503 |
INTERNALSHUTDOWN
Shutdown command (internal password protected command).
|
LIMITBANDWIDTH
Change the Limit of the global bandwidth.
|
LIST
This command causes a list to be sent from the server to the passive
DTP.
|
MDTM
The FTP command, MODIFICATION TIME (MDTM), can be used to determine when
a
file in the server NVFS was last
modified.
|
MKD
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).
|
MLSD
The MLSD command is intended to standardize the file and directory
information returned by the server-FTP
process.
|
MLST
The MLST command is intended to standardize the file and directory
information returned by the server-FTP
process.
|
MODE
The argument is a single Telnet character code specifying the data
transfer
modes described in the Section
on Transmission Modes.
|
NLST
This command causes a directory listing to be sent from server to user
site.
|
NOOP
This command does not affect any parameters or previously entered
commands.
|
OPTS
The OPTS (options) command allows a user-PI to specify the desired
behavior
of a server-FTP process when
another FTP command (the target command) is later issued.
|
PASS
The argument field is a Telnet string specifying the user's password.
|
PASV
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.
|
PBSZ
Data protection negotiation commands
PBSZ 0 200 503, 500, 501, 421, 530 |
PORT
The argument is a HOST-PORT specification for the data port to be used
in
data connection.
|
PROT
Data protection negotiation commands
PROT P (Data) PROT C (Data SSL Off) 200 504, 536*, 503, 534*, 431* 500, 501, 421, 530 |
PWD
This command causes the name of the current working directory to be
returned in the reply.
|
QUIT
This command terminates a USER and if file transfer is not in progress,
the
server closes the control
connection.
|
REIN
This command terminates a USER, flushing all I/O and account
information,
except to allow any transfer in
progress to be completed.
|
REST
The argument field represents the server marker at which file transfer
is
to be restarted.
|
RETR
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.
|
RMD
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).
|
RNFR
This command specifies the old pathname of the file which is to be
renamed.
|
RNTO
This command specifies the new pathname of the file specified in the
immediately preceding "rename from"
RNFR command.
|
SITE
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.
|
SIZE
The FTP command, SIZE OF FILE (SIZE), is used to obtain the transfer
size
of a file from the server-FTP
process.
|
SMNT
This command allows the user to mount a different file system data
structure without altering his login or
accounting information.
|
STAT
This command shall cause a status response to be sent over the control
connection in the form of a reply.
|
STOR
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.
|
STOU
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.
|
STRU
The argument is a single Telnet character code specifying file structure
described in the Section on Data
Representation and Storage.
|
SYST
This command is used to find out the type of operating system at the
server.
|
TYPE
The argument specifies the representation type as described in the
Section
on Data Representation and
Storage.
|
Unimplemented
Unimplemented command
Always return 502 |
Unknown
Unknown Command from control network
Always return 500 |
USER
The argument field is a Telnet string identifying the user.
|
XCRC
Compute CRC on pathname given as argument.
|
XCUP
Change to the parent of the current working directory.
|
XCWD
Change to a new working directory.
|
XDIGEST
Compute Digest on pathname given as second argument, first being the
digest algorithm.
|
XMD5
Compute MD5 on pathname given as argument.
|
XMKD
Make a directory.
|
XPWD
Print the current working directory.
|
XRMD
Remove the directory.
|
XSHA1
Compute SHA-1 on pathname given as argument.
|
Modifier and Type | Field and Description |
---|---|
Class<? extends AbstractCommand> |
command
The Class that implements this command
|
Class<?>[] |
nextValids
Next valids class that could follow this command (null means any)
|
Class<? extends AbstractCommand> |
previousValid
Previous positive class that must precede this command (null means any)
|
Modifier and Type | Method and Description |
---|---|
static AbstractCommand |
getFromLine(FtpSession session,
String line)
Get the corresponding AbstractCommand object from the line received from
the client associated with the
handler
|
static boolean |
isDataConnectionUsageCommand(FtpCommandCode command)
True if the command is using a Data connection
|
static boolean |
isExtensionCommand(FtpCommandCode command)
True if the command is an extension operation (XMD5, XCRC, XSHA1, ...)
|
static boolean |
isListLikeCommand(FtpCommandCode command)
True if the command is a List like operation (LIST, NLST, MLSD, MLST,
...)
|
static boolean |
isRetrLikeCommand(FtpCommandCode command)
True if the command is a Retrieve like operation (RETR, ...)
|
static boolean |
isSpecialCommand(FtpCommandCode command)
True if the command is a special operation (QUIT, ABOR, NOOP, STAT, ...)
|
static boolean |
isSslOrAuthCommand(FtpCommandCode command)
True if the command is Ssl related (AUTH, PBSZ, PROT, USER, PASS, ACCT)
|
static boolean |
isStoreLikeCommand(FtpCommandCode command)
True if the command is a Store like operation (APPE, STOR, STOU, ...)
|
static boolean |
isStorOrRetrLikeCommand(FtpCommandCode command)
True if the command is a Retrieve or Store like operation
|
String |
toString() |
static FtpCommandCode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FtpCommandCode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FtpCommandCode Connection
120->220
220
421
public static final FtpCommandCode USER
230
530
500, 501, 421
331, 332
public static final FtpCommandCode PASS
230
202
530
500, 501, 503, 421
332
public static final FtpCommandCode ACCT
There are reply codes to differentiate these cases for the automation:
when
account information is required
for login, the response to a successful PASSword command is reply code
332.
On the other hand, if account
information is NOT required for login, the reply to a successful
PASSword
command is 230; and if the
account information is needed for a command issued later in the
dialogue,
the server should return a 332 or
532 reply depending on whether it stores (pending receipt of the ACCounT
command) or discards the command,
respectively.
230
202
530
500, 501, 503, 421
public static final FtpCommandCode CWD
250
500, 501, 502, 421, 530, 550
public static final FtpCommandCode CDUP
200
500, 501, 502, 421, 530, 550
public static final FtpCommandCode SMNT
202, 250
500, 501, 502, 421, 530, 550
public static final FtpCommandCode REIN
120
220
220
421
500, 502
public static final FtpCommandCode QUIT
An unexpected close on the control connection will cause the server to
take
the effective action of an
abort (ABOR) and a logout (QUIT).
221
500
public static final FtpCommandCode PORT
PORT h1,h2,h3,h4,p1,p2
where h1 is the high order 8 bits of the internet host address.
200
500, 501, 421, 530
public static final FtpCommandCode PASV
227
500, 501, 502, 421, 530
public static final FtpCommandCode TYPE
<SP>
(Space,
ASCII code 32).
The following codes are assigned for type:
\ / A - ASCII | | N - Non-print |-><-| T - Telnet format effectors E - EBCDIC| | C - Carriage Control (ASA) / \ I - Image L <byte size> - Local byte Byte size
The default representation type is ASCII Non-print. If the Format
parameter
is changed, and later just the
first argument is changed, Format then returns to the Non-print
default.
200
500, 501, 504, 421, 530
public static final FtpCommandCode STRU
The following codes are assigned for structure:
F - FtpFile (no record structure) R - Record structure P - Page structure
The default structure is FtpFile.
200
500, 501, 504, 421, 530
public static final FtpCommandCode MODE
The following codes are assigned for transfer modes:
S - Stream B - Block C - Compressed
The default transfer mode is Stream.
200
500, 501, 504, 421, 530
public static final FtpCommandCode RETR
125, 150
(110)
226, 250
425, 426, 451
450, 550
500, 501, 421, 530
public static final FtpCommandCode STOR
125, 150
(110)
226, 250
425, 426, 451, 551, 552
532, 450, 452, 553
500, 501, 421, 530
public static final FtpCommandCode STOU
125, 150
(110)
226, 250
425, 426, 451, 551, 552
532, 450, 452, 553
500, 501, 421, 530
public static final FtpCommandCode APPE
125, 150
(110)
226, 250
425, 426, 451, 551, 552
532, 450, 452, 553
500, 501, 421, 530
public static final FtpCommandCode ALLO
<SP>
R <SP>
.
This command shall be followed by a STORe or APPEnd command. The ALLO
command should be treated as a NOOP
(no operation) by those servers which do not require that the maximum
size
of the file be declared
beforehand, and those servers interested in only the maximum record or
page
size should accept a dummy
value in the first argument and ignore it.
125, 150
226, 250
425, 426, 451
450
500, 501, 502, 421, 530
public static final FtpCommandCode REST
FtpFile
restartMarker method.
500, 501, 502, 421, 530
350
public static final FtpCommandCode RNFR
450, 550
500, 501, 502, 421, 530
350
public static final FtpCommandCode RNTO
250
532, 553
500, 501, 502, 503, 421, 530
public static final FtpCommandCode ABOR
There are two cases for the server upon receipt of this command: (1) the
FTP service command was already
completed, or (2) the FTP service command is still in progress.
In the first case, the server closes the data connection (if it is open)
and responds with a 226 reply,
indicating that the abort command was successfully processed.
In the second case, the server aborts the FTP service in progress and
closes the data connection, returning
a 426 reply to indicate that the service request terminated abnormally.
The
server then sends a 226 reply,
indicating that the abort command was successfully processed.
225, 226
500, 501, 502, 421
public static final FtpCommandCode DELE
250
450, 550
500, 501, 502, 421, 530
public static final FtpCommandCode RMD
250
500, 501, 502, 421, 530, 550
public static final FtpCommandCode MKD
257
500, 501, 502, 421, 530, 550
public static final FtpCommandCode PWD
257
500, 501, 502, 421, 550
public static final FtpCommandCode LIST
125, 150
226, 250
425, 426, 451
450
500, 501, 502, 421, 530
public static final FtpCommandCode NLST
<CRLF>
or <NL>
. (Again the user
must
ensure that the TYPE is
correct.) This command is intended to return information that can be
used
by a program to further process
the files automatically. For example, in the implementation of a
"multiple
get" function.
125, 150
226, 250
425, 426, 451
450
500, 501, 502, 421, 530
public static final FtpCommandCode SITE
200
202
500, 501, 530
public static final FtpCommandCode SYST
215
500, 501, 502, 421
public static final FtpCommandCode STAT
211, 212, 213
450
500, 501, 502, 421, 530
public static final FtpCommandCode HELP
211, 214
500, 501, 502, 421
public static final FtpCommandCode NOOP
200
500 421
public static final FtpCommandCode XCWD
250
500, 501, 502, 421, 530, 550
public static final FtpCommandCode XCUP
200
500, 501, 502, 421, 530, 550
public static final FtpCommandCode XRMD
250
500, 501, 502, 421, 530, 550
public static final FtpCommandCode XMKD
257
500, 501, 502, 421, 530, 550
public static final FtpCommandCode XPWD
257
500, 501, 502, 421, 550
public static final FtpCommandCode MDTM
The "pathname" specifies an object in the NVFS that may be the object of
a
RETR command. Attempts to query
the modification time of files that exist but are unable to be retrieved
may generate an error- response,
or can result in a positive response carrying a time-val with an
unspecified value, the choice being made
by the server-PI.
The server-PI will respond to the MDTM command with a 213 reply giving
the
last modification time of the
file whose pathname was supplied, or a 550 reply if the file does not
exist, the modification time is
unavailable, or some other error has occurred.
213
500, 501, 550
public static final FtpCommandCode SIZE
The SIZE command returns how many octets would be transferred if the
file
were to be transferred using the
current transfer structure, mode, and type. This command is normally
used
in conjunction with the RESTART
(REST) command when STORing a file to a remote server in STREAM mode, to
determine the restart point. The
server-PI might need to read the partially transferred file, do any
appropriate conversion, and count the
number of octets that would be generated when sending the file in order
to
correctly respond to this
command. Estimates of the file transfer size MUST NOT be returned; only
precise information is
acceptable.
213
500, 501, 550
public static final FtpCommandCode MLSD
MLSD lists the contents of a directory if a directory is named, otherwise
a
501 reply is returned. If no
object is named, the current directory is assumed. That will cause MLSD
to
list the contents of the current
directory.
125, 150
226, 250
425, 426, 451
450
500, 501, 502, 421, 530
public static final FtpCommandCode MLST
MLST provides data about exactly the object named on its command line,
and
no others. If no object is
named, the current directory is assumed. That will cause MLST to send a
one-line response, describing the
current directory itself.
125, 150
226, 250
425, 426, 451
450
500, 501, 502, 421, 530
public static final FtpCommandCode FEAT
Where a server-FTP process does not support the FEAT command, it will
respond to the FEAT command with a
500 or 502 reply. This is simply the normal "unrecognized command" reply
that any unknown command would
elicit. Errors in the command syntax, such as giving parameters, will
result in a 501 reply.
Server-FTP processes that recognize the FEAT command, but implement no
extended features, and therefore
have nothing to report, SHOULD respond with the "no-features" 211 reply.
However, as this case is
practically indistinguishable from a server-FTP that does not recognize
the
FEAT command, a 500 or 502
reply MAY also be used. The "no-features" reply MUST NOT use the
multi-line
response format, exactly one
response line is required and permitted.
Replies to the FEAT command MUST comply with the following syntax. Text
on
the first line of the reply is
free form, and not interpreted, and has no practical use, as this text
is
not expected to be revealed to
end users. The syntax of other reply lines is precisely defined, and if
present, MUST be exactly as
specified.
feat-response = error-response / no-features / feature-listing no-features = "211" SP *TCHAR CRLF feature-listing = "211-" *TCHAR CRLF 1*( SP feature CRLF ) "211 End" CRLF feature = feature-label [ SP feature-parms ] feature-label = 1*VCHAR feature-parms = 1*TCHAR
Note that each feature line in the feature-listing begins with a single
space. That space is not optional,
nor does it indicate general white space. This space guarantees that the
feature line can never be
misinterpreted as the end of the feature-listing, but is required even
where there is no possibility of
ambiguity.
Each extension supported must be listed on a separate line to facilitate
the possible inclusion of
parameters supported by each extension command. The feature-label to be
used in the response to the FEAT
command will be specified as each new feature is added to the FTP
command
set. Often it will be the name of
a new command added, however this is not required. In fact it is not
required that a new feature actually
add a new command. Any parameters included are to be specified with the
definition of the command
concerned. That specification shall also specify how any parameters
present
are to be interpreted.
The feature-label and feature-parms are nominally case sensitive,
however
the definitions of specific
labels and parameters specify the precise interpretation, and it is to
be
expected that those definitions
will usually specify the label and parameters in a case independent
manner.
Where this is done,
implementations are recommended to use upper case letters when
transmitting
the feature response.
The FEAT command itself is not included in the list of features
supported,
support for the FEAT command is
indicated by return of a reply other than a 500 or 502 reply.
211
500, 501, 550
public static final FtpCommandCode OPTS
200
451, 500, 501, 550
public static final FtpCommandCode EPRT
EPRT<space><d><net-prt><d><net-addr><d><tcp-port><d>
<d>
) MUST be specified. The delimiter
character MUST be one of the ASCII
characters in range 33-126 inclusive. The character "|" (ASCII 124) is
recommended unless it coincides with
a character needed to encode the network address.
The <net-prt>
argument MUST be an address family
number
defined by IANA in the latest
Assigned Numbers RFC (RFC 1700 [RP94] as of the writing of this
document).
This number indicates the
protocol to be used (and, implicitly, the address length). This document
will use two of address family
numbers from [RP94] as examples, according to the following table:
AF Number Protocol --------- -------- 1 Internet Protocol, Version 4 [Pos81a] 2 Internet Protocol, Version 6 [DH96]
<net-addr>
is a protocol specific string
representation of the network address. For
the two address families specified above (AF Number 1 and 2), addresses
MUST be in the following
format:AF Number Address Format Example --------- -------------- ------- 1 dotted decimal 132.235.1.2 2 IPv6 string 1080::8:800:200C:417A representations defined in [HD96]
<tcp-port>
argument must be the string
representation of the number of the TCP port
on which the host is listening for the data connection.
200
500, 501, 522, 421, 530
public static final FtpCommandCode EPSV
2yz Positive Completion x2z Connections xy9 Extended Passive Mode Entered
<text indicating server is entering extended passive mode> (<d><d><d><tcp-port><d>)
The first two fields contained in the parenthesis MUST be blank. The
third
field MUST be the string
representation of the TCP port number on which the server is listening
for
a data connection. The network
protocol used by the data connection will be the same network protocol
used
by the control connection. In
addition, the network address used to establish the data connection will
be
the same network address used
for the control connection. An example response string follows:
Entering Extended Passive Mode (|||6446|)
When the EPSV command is issued with no argument, the server will choose
the network protocol for the data
connection based on the protocol used for the control connection.
However,
in the case of proxy FTP, this
protocol might not be appropriate for communication between the two
servers. Therefore, the client needs to
be able to request a specific protocol. If the server returns a protocol
that is not supported by the host
that will be connecting to the port, the client MUST issue an ABOR
(abort)
command to allow the server to
close down the listening connection. The client can then send an EPSV
command requesting the use of a
specific network protocol, as follows:
EPSV<space><net-prt>
EPSV < space > ALL
229
500, 501, 502, 522, 421, 530
public static final FtpCommandCode XCRC
250
500, 501, 502, 504, 421, 530
public static final FtpCommandCode XMD5
250
500, 501, 502, 504, 421, 530
public static final FtpCommandCode XSHA1
250
500, 501, 502, 504, 421, 530
public static final FtpCommandCode XDIGEST
250
500, 501, 502, 504, 421, 530
public static final FtpCommandCode Unknown
public static final FtpCommandCode Unimplemented
public static final FtpCommandCode IncorrectSequence
public static final FtpCommandCode INTERNALSHUTDOWN
public static final FtpCommandCode LIMITBANDWIDTH
public static final FtpCommandCode AUTH
public static final FtpCommandCode CCC
public static final FtpCommandCode PROT
public static final FtpCommandCode PBSZ
public final Class<? extends AbstractCommand> command
public final Class<? extends AbstractCommand> previousValid
public final Class<?>[] nextValids
public static FtpCommandCode[] values()
for (FtpCommandCode c : FtpCommandCode.values()) System.out.println(c);
public static FtpCommandCode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static AbstractCommand getFromLine(FtpSession session, String line)
session
- line
- public static boolean isStoreLikeCommand(FtpCommandCode command)
command
- public static boolean isRetrLikeCommand(FtpCommandCode command)
command
- public static boolean isStorOrRetrLikeCommand(FtpCommandCode command)
command
- public static boolean isListLikeCommand(FtpCommandCode command)
command
- public static boolean isDataConnectionUsageCommand(FtpCommandCode command)
command
- public static boolean isSpecialCommand(FtpCommandCode command)
command
- public static boolean isSslOrAuthCommand(FtpCommandCode command)
command
- public static boolean isExtensionCommand(FtpCommandCode command)
command
- public String toString()
toString
in class Enum<FtpCommandCode>
Copyright © 2009–2020 Waarp. All rights reserved.