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 intACTION_ABORTED
static intBAD_COMMAND_SEQUENCE
static intCANNOT_OPEN_DATA_CONNECTION
static intCLOSING_DATA_CONNECTION
static intCODE_110
static intCODE_120
static intCODE_125
static intCODE_150
static intCODE_200
static intCODE_202
static intCODE_211
static intCODE_212
static intCODE_213
static intCODE_214
static intCODE_215
static intCODE_220
static intCODE_221
static intCODE_225
static intCODE_226
static intCODE_227
static intCODE_230
static intCODE_250
static intCODE_257
static intCODE_331
static intCODE_332
static intCODE_350
static intCODE_421
static intCODE_425
static intCODE_426
static intCODE_450
static intCODE_451
static intCODE_452
static intCODE_500
static intCODE_501
static intCODE_502
static intCODE_503
static intCODE_504
static intCODE_521
static intCODE_530
static intCODE_532
static intCODE_550
static intCODE_551
static intCODE_552
static intCODE_553
static intCOMMAND_IS_SUPERFLUOUS
static intCOMMAND_NOT_IMPLEMENTED
static intCOMMAND_NOT_IMPLEMENTED_FOR_PARAMETER
static intCOMMAND_OK
static intDATA_CONNECTION_ALREADY_OPEN
static intDATA_CONNECTION_OPEN
static intDIRECTORY_STATUS
static intENTERING_PASSIVE_MODE
static intFILE_ACTION_NOT_TAKEN
static intFILE_ACTION_OK
static intFILE_ACTION_PENDING
static intFILE_NAME_NOT_ALLOWED
static intFILE_STATUS
static intFILE_STATUS_OK
static intFILE_UNAVAILABLE
static intHELP_MESSAGE
static intINSUFFICIENT_STORAGE
static intNAME_SYSTEM_TYPE
static intNEED_ACCOUNT
static intNEED_ACCOUNT_FOR_STORING_FILES
static intNEED_PASSWORD
static intNOT_LOGGED_IN
static intPAGE_TYPE_UNKNOWN
static intPATHNAME_CREATED
static intRESTART_MARKER
static intSERVICE_CLOSING_CONTROL_CONNECTION
static intSERVICE_NOT_AVAILABLE
static intSERVICE_NOT_READY
static intSERVICE_READY
static intSTORAGE_ALLOCATION_EXCEEDED
static intSYNTAX_ERROR_IN_ARGUMENTS
static intSYSTEM_STATUS
static intTRANSFER_ABORTED
static intUNRECOGNIZED_COMMAND
static intUSER_LOGGED_IN
Method Summary
static booleanisNegativePermanent(int reply)
Determine if a reply code is a negative permanent response.
static booleanisNegativeTransient(int reply)
Determine if a reply code is a negative transient response.
static booleanisPositiveCompletion(int reply)
Determine if a reply code is a positive completion response.
static booleanisPositiveIntermediate(int reply)
Determine if a reply code is a positive intermediate response.
static booleanisPositivePreliminary(int reply)
Determine if a reply code is a positive preliminary response.

Field Detail

ACTION_ABORTED

public static final int ACTION_ABORTED

BAD_COMMAND_SEQUENCE

public static final int BAD_COMMAND_SEQUENCE

CANNOT_OPEN_DATA_CONNECTION

public static final int CANNOT_OPEN_DATA_CONNECTION

CLOSING_DATA_CONNECTION

public static final int CLOSING_DATA_CONNECTION

CODE_110

public static final int CODE_110

CODE_120

public static final int CODE_120

CODE_125

public static final int CODE_125

CODE_150

public static final int CODE_150

CODE_200

public static final int CODE_200

CODE_202

public static final int CODE_202

CODE_211

public static final int CODE_211

CODE_212

public static final int CODE_212

CODE_213

public static final int CODE_213

CODE_214

public static final int CODE_214

CODE_215

public static final int CODE_215

CODE_220

public static final int CODE_220

CODE_221

public static final int CODE_221

CODE_225

public static final int CODE_225

CODE_226

public static final int CODE_226

CODE_227

public static final int CODE_227

CODE_230

public static final int CODE_230

CODE_250

public static final int CODE_250

CODE_257

public static final int CODE_257

CODE_331

public static final int CODE_331

CODE_332

public static final int CODE_332

CODE_350

public static final int CODE_350

CODE_421

public static final int CODE_421

CODE_425

public static final int CODE_425

CODE_426

public static final int CODE_426

CODE_450

public static final int CODE_450

CODE_451

public static final int CODE_451

CODE_452

public static final int CODE_452

CODE_500

public static final int CODE_500

CODE_501

public static final int CODE_501

CODE_502

public static final int CODE_502

CODE_503

public static final int CODE_503

CODE_504

public static final int CODE_504

CODE_521

public static final int CODE_521

CODE_530

public static final int CODE_530

CODE_532

public static final int CODE_532

CODE_550

public static final int CODE_550

CODE_551

public static final int CODE_551

CODE_552

public static final int CODE_552

CODE_553

public static final int CODE_553

COMMAND_IS_SUPERFLUOUS

public static final int COMMAND_IS_SUPERFLUOUS

COMMAND_NOT_IMPLEMENTED

public static final int COMMAND_NOT_IMPLEMENTED

COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER

public static final int COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER

COMMAND_OK

public static final int COMMAND_OK

DATA_CONNECTION_ALREADY_OPEN

public static final int DATA_CONNECTION_ALREADY_OPEN

DATA_CONNECTION_OPEN

public static final int DATA_CONNECTION_OPEN

DIRECTORY_STATUS

public static final int DIRECTORY_STATUS

ENTERING_PASSIVE_MODE

public static final int ENTERING_PASSIVE_MODE

FILE_ACTION_NOT_TAKEN

public static final int FILE_ACTION_NOT_TAKEN

FILE_ACTION_OK

public static final int FILE_ACTION_OK

FILE_ACTION_PENDING

public static final int FILE_ACTION_PENDING

FILE_NAME_NOT_ALLOWED

public static final int FILE_NAME_NOT_ALLOWED

FILE_STATUS

public static final int FILE_STATUS

FILE_STATUS_OK

public static final int FILE_STATUS_OK

FILE_UNAVAILABLE

public static final int FILE_UNAVAILABLE

HELP_MESSAGE

public static final int HELP_MESSAGE

INSUFFICIENT_STORAGE

public static final int INSUFFICIENT_STORAGE

NAME_SYSTEM_TYPE

public static final int NAME_SYSTEM_TYPE

NEED_ACCOUNT

public static final int NEED_ACCOUNT

NEED_ACCOUNT_FOR_STORING_FILES

public static final int NEED_ACCOUNT_FOR_STORING_FILES

NEED_PASSWORD

public static final int NEED_PASSWORD

NOT_LOGGED_IN

public static final int NOT_LOGGED_IN

PAGE_TYPE_UNKNOWN

public static final int PAGE_TYPE_UNKNOWN

PATHNAME_CREATED

public static final int PATHNAME_CREATED

RESTART_MARKER

public static final int RESTART_MARKER

SERVICE_CLOSING_CONTROL_CONNECTION

public static final int SERVICE_CLOSING_CONTROL_CONNECTION

SERVICE_NOT_AVAILABLE

public static final int SERVICE_NOT_AVAILABLE

SERVICE_NOT_READY

public static final int SERVICE_NOT_READY

SERVICE_READY

public static final int SERVICE_READY

STORAGE_ALLOCATION_EXCEEDED

public static final int STORAGE_ALLOCATION_EXCEEDED

SYNTAX_ERROR_IN_ARGUMENTS

public static final int SYNTAX_ERROR_IN_ARGUMENTS

SYSTEM_STATUS

public static final int SYSTEM_STATUS

TRANSFER_ABORTED

public static final int TRANSFER_ABORTED

UNRECOGNIZED_COMMAND

public static final int UNRECOGNIZED_COMMAND

USER_LOGGED_IN

public static final int USER_LOGGED_IN

Method Detail

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.