org.apache.commons.net.ftp

Class FTPReply


public final class FTPReply
extends Object

FTPReply stores a set of constants for FTP reply codes. To interpret the meaning of the codes, familiarity with RFC 959 is assumed. The mnemonic constant names are transcriptions from the code descriptions of RFC 959. For those who think in terms of the actual reply code values, a set of CODE_NUM constants are provided where NUM is the numerical value of the code.

Author:
Daniel F. Savarese

Field Summary

static int
ACTION_ABORTED
static int
BAD_COMMAND_SEQUENCE
static int
CANNOT_OPEN_DATA_CONNECTION
static int
CLOSING_DATA_CONNECTION
static int
CODE_110
static int
CODE_120
static int
CODE_125
static int
CODE_150
static int
CODE_200
static int
CODE_202
static int
CODE_211
static int
CODE_212
static int
CODE_213
static int
CODE_214
static int
CODE_215
static int
CODE_220
static int
CODE_221
static int
CODE_225
static int
CODE_226
static int
CODE_227
static int
CODE_230
static int
CODE_250
static int
CODE_257
static int
CODE_331
static int
CODE_332
static int
CODE_350
static int
CODE_421
static int
CODE_425
static int
CODE_426
static int
CODE_450
static int
CODE_451
static int
CODE_452
static int
CODE_500
static int
CODE_501
static int
CODE_502
static int
CODE_503
static int
CODE_504
static int
CODE_521
static int
CODE_530
static int
CODE_532
static int
CODE_550
static int
CODE_551
static int
CODE_552
static int
CODE_553
static int
COMMAND_IS_SUPERFLUOUS
static int
COMMAND_NOT_IMPLEMENTED
static int
COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER
static int
COMMAND_OK
static int
DATA_CONNECTION_ALREADY_OPEN
static int
DATA_CONNECTION_OPEN
static int
DIRECTORY_STATUS
static int
ENTERING_PASSIVE_MODE
static int
FILE_ACTION_NOT_TAKEN
static int
FILE_ACTION_OK
static int
FILE_ACTION_PENDING
static int
FILE_NAME_NOT_ALLOWED
static int
FILE_STATUS
static int
FILE_STATUS_OK
static int
FILE_UNAVAILABLE
static int
HELP_MESSAGE
static int
INSUFFICIENT_STORAGE
static int
NAME_SYSTEM_TYPE
static int
NEED_ACCOUNT
static int
NEED_ACCOUNT_FOR_STORING_FILES
static int
NEED_PASSWORD
static int
NOT_LOGGED_IN
static int
PAGE_TYPE_UNKNOWN
static int
PATHNAME_CREATED
static int
RESTART_MARKER
static int
SERVICE_CLOSING_CONTROL_CONNECTION
static int
SERVICE_NOT_AVAILABLE
static int
SERVICE_NOT_READY
static int
SERVICE_READY
static int
STORAGE_ALLOCATION_EXCEEDED
static int
SYNTAX_ERROR_IN_ARGUMENTS
static int
SYSTEM_STATUS
static int
TRANSFER_ABORTED
static int
UNRECOGNIZED_COMMAND
static int
USER_LOGGED_IN

Method Summary

static boolean
isNegativePermanent(int reply)
Determine if a reply code is a negative permanent response.
static boolean
isNegativeTransient(int reply)
Determine if a reply code is a negative transient response.
static boolean
isPositiveCompletion(int reply)
Determine if a reply code is a positive completion response.
static boolean
isPositiveIntermediate(int reply)
Determine if a reply code is a positive intermediate response.
static boolean
isPositivePreliminary(int reply)
Determine if a reply code is a positive preliminary response.

Field Details

ACTION_ABORTED

public static final int ACTION_ABORTED
Field Value:
451

BAD_COMMAND_SEQUENCE

public static final int BAD_COMMAND_SEQUENCE
Field Value:
503

CANNOT_OPEN_DATA_CONNECTION

public static final int CANNOT_OPEN_DATA_CONNECTION
Field Value:
425

CLOSING_DATA_CONNECTION

public static final int CLOSING_DATA_CONNECTION
Field Value:
226

CODE_110

public static final int CODE_110
Field Value:
110

CODE_120

public static final int CODE_120
Field Value:
120

CODE_125

public static final int CODE_125
Field Value:
125

CODE_150

public static final int CODE_150
Field Value:
150

CODE_200

public static final int CODE_200
Field Value:
200

CODE_202

public static final int CODE_202
Field Value:
202

CODE_211

public static final int CODE_211
Field Value:
211

CODE_212

public static final int CODE_212
Field Value:
212

CODE_213

public static final int CODE_213
Field Value:
213

CODE_214

public static final int CODE_214
Field Value:
214

CODE_215

public static final int CODE_215
Field Value:
215

CODE_220

public static final int CODE_220
Field Value:
220

CODE_221

public static final int CODE_221
Field Value:
221

CODE_225

public static final int CODE_225
Field Value:
225

CODE_226

public static final int CODE_226
Field Value:
226

CODE_227

public static final int CODE_227
Field Value:
227

CODE_230

public static final int CODE_230
Field Value:
230

CODE_250

public static final int CODE_250
Field Value:
250

CODE_257

public static final int CODE_257
Field Value:
257

CODE_331

public static final int CODE_331
Field Value:
331

CODE_332

public static final int CODE_332
Field Value:
332

CODE_350

public static final int CODE_350
Field Value:
350

CODE_421

public static final int CODE_421
Field Value:
421

CODE_425

public static final int CODE_425
Field Value:
425

CODE_426

public static final int CODE_426
Field Value:
426

CODE_450

public static final int CODE_450
Field Value:
450

CODE_451

public static final int CODE_451
Field Value:
451

CODE_452

public static final int CODE_452
Field Value:
452

CODE_500

public static final int CODE_500
Field Value:
500

CODE_501

public static final int CODE_501
Field Value:
501

CODE_502

public static final int CODE_502
Field Value:
502

CODE_503

public static final int CODE_503
Field Value:
503

CODE_504

public static final int CODE_504
Field Value:
504

CODE_521

public static final int CODE_521
Field Value:
521

CODE_530

public static final int CODE_530
Field Value:
530

CODE_532

public static final int CODE_532
Field Value:
532

CODE_550

public static final int CODE_550
Field Value:
550

CODE_551

public static final int CODE_551
Field Value:
551

CODE_552

public static final int CODE_552
Field Value:
552

CODE_553

public static final int CODE_553
Field Value:
553

COMMAND_IS_SUPERFLUOUS

public static final int COMMAND_IS_SUPERFLUOUS
Field Value:
202

COMMAND_NOT_IMPLEMENTED

public static final int COMMAND_NOT_IMPLEMENTED
Field Value:
502

COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER

public static final int COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER
Field Value:
504

COMMAND_OK

public static final int COMMAND_OK
Field Value:
200

DATA_CONNECTION_ALREADY_OPEN

public static final int DATA_CONNECTION_ALREADY_OPEN
Field Value:
125

DATA_CONNECTION_OPEN

public static final int DATA_CONNECTION_OPEN
Field Value:
225

DIRECTORY_STATUS

public static final int DIRECTORY_STATUS
Field Value:
212

ENTERING_PASSIVE_MODE

public static final int ENTERING_PASSIVE_MODE
Field Value:
227

FILE_ACTION_NOT_TAKEN

public static final int FILE_ACTION_NOT_TAKEN
Field Value:
450

FILE_ACTION_OK

public static final int FILE_ACTION_OK
Field Value:
250

FILE_ACTION_PENDING

public static final int FILE_ACTION_PENDING
Field Value:
350

FILE_NAME_NOT_ALLOWED

public static final int FILE_NAME_NOT_ALLOWED
Field Value:
553

FILE_STATUS

public static final int FILE_STATUS
Field Value:
213

FILE_STATUS_OK

public static final int FILE_STATUS_OK
Field Value:
150

FILE_UNAVAILABLE

public static final int FILE_UNAVAILABLE
Field Value:
550

HELP_MESSAGE

public static final int HELP_MESSAGE
Field Value:
214

INSUFFICIENT_STORAGE

public static final int INSUFFICIENT_STORAGE
Field Value:
452

NAME_SYSTEM_TYPE

public static final int NAME_SYSTEM_TYPE
Field Value:
215

NEED_ACCOUNT

public static final int NEED_ACCOUNT
Field Value:
332

NEED_ACCOUNT_FOR_STORING_FILES

public static final int NEED_ACCOUNT_FOR_STORING_FILES
Field Value:
532

NEED_PASSWORD

public static final int NEED_PASSWORD
Field Value:
331

NOT_LOGGED_IN

public static final int NOT_LOGGED_IN
Field Value:
530

PAGE_TYPE_UNKNOWN

public static final int PAGE_TYPE_UNKNOWN
Field Value:
551

PATHNAME_CREATED

public static final int PATHNAME_CREATED
Field Value:
257

RESTART_MARKER

public static final int RESTART_MARKER
Field Value:
110

SERVICE_CLOSING_CONTROL_CONNECTION

public static final int SERVICE_CLOSING_CONTROL_CONNECTION
Field Value:
221

SERVICE_NOT_AVAILABLE

public static final int SERVICE_NOT_AVAILABLE
Field Value:
421

SERVICE_NOT_READY

public static final int SERVICE_NOT_READY
Field Value:
120

SERVICE_READY

public static final int SERVICE_READY
Field Value:
220

STORAGE_ALLOCATION_EXCEEDED

public static final int STORAGE_ALLOCATION_EXCEEDED
Field Value:
552

SYNTAX_ERROR_IN_ARGUMENTS

public static final int SYNTAX_ERROR_IN_ARGUMENTS
Field Value:
501

SYSTEM_STATUS

public static final int SYSTEM_STATUS
Field Value:
211

TRANSFER_ABORTED

public static final int TRANSFER_ABORTED
Field Value:
426

UNRECOGNIZED_COMMAND

public static final int UNRECOGNIZED_COMMAND
Field Value:
500

USER_LOGGED_IN

public static final int USER_LOGGED_IN
Field Value:
230

Method Details

isNegativePermanent

public static boolean isNegativePermanent(int reply)
Determine if a reply code is a negative permanent response. All codes beginning with a 5 are negative permanent responses. The FTP server will send a negative permanent response on the failure of a command that cannot be reattempted with success.

Parameters:
reply - The reply code to test.
Returns:
True if a reply code is a negative permanent response, false if not.

isNegativeTransient

public static boolean isNegativeTransient(int reply)
Determine if a reply code is a negative transient response. All codes beginning with a 4 are negative transient responses. The FTP server will send a negative transient response on the failure of a command that can be reattempted with success.

Parameters:
reply - The reply code to test.
Returns:
True if a reply code is a negative transient response, false if not.

isPositiveCompletion

public static boolean isPositiveCompletion(int reply)
Determine if a reply code is a positive completion response. All codes beginning with a 2 are positive completion responses. The FTP server will send a positive completion response on the final successful completion of a command.

Parameters:
reply - The reply code to test.
Returns:
True if a reply code is a postive completion response, false if not.

isPositiveIntermediate

public static boolean isPositiveIntermediate(int reply)
Determine if a reply code is a positive intermediate response. All codes beginning with a 3 are positive intermediate responses. The FTP server will send a positive intermediate response on the successful completion of one part of a multi-part sequence of commands. For example, after a successful USER command, a positive intermediate response will be sent to indicate that the server is ready for the PASS command.

Parameters:
reply - The reply code to test.
Returns:
True if a reply code is a postive intermediate response, false if not.

isPositivePreliminary

public static boolean isPositivePreliminary(int reply)
Determine if a reply code is a positive preliminary response. All codes beginning with a 1 are positive preliminary responses. Postitive preliminary responses are used to indicate tentative success. No further commands can be issued to the FTP server after a positive preliminary response until a follow up response is received from the server.

Parameters:
reply - The reply code to test.
Returns:
True if a reply code is a postive preliminary response, false if not.