Class FTPReply

java.lang.Object
org.apache.commons.net.ftp.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.

TODO replace with an enum

  • Field Details

    • RESTART_MARKER

      public static final int RESTART_MARKER
      Reply code 110.
      See Also:
    • SERVICE_NOT_READY

      public static final int SERVICE_NOT_READY
      Reply code 120.
      See Also:
    • DATA_CONNECTION_ALREADY_OPEN

      public static final int DATA_CONNECTION_ALREADY_OPEN
      Reply code 125.
      See Also:
    • FILE_STATUS_OK

      public static final int FILE_STATUS_OK
      Reply code 150.
      See Also:
    • COMMAND_OK

      public static final int COMMAND_OK
      Reply code 200.
      See Also:
    • COMMAND_IS_SUPERFLUOUS

      public static final int COMMAND_IS_SUPERFLUOUS
      Reply code 202.
      See Also:
    • SYSTEM_STATUS

      public static final int SYSTEM_STATUS
      Reply code 211.
      See Also:
    • DIRECTORY_STATUS

      public static final int DIRECTORY_STATUS
      Reply code 212.
      See Also:
    • FILE_STATUS

      public static final int FILE_STATUS
      Reply code 213.
      See Also:
    • HELP_MESSAGE

      public static final int HELP_MESSAGE
      Reply code 214.
      See Also:
    • NAME_SYSTEM_TYPE

      public static final int NAME_SYSTEM_TYPE
      Reply code 215.
      See Also:
    • SERVICE_READY

      public static final int SERVICE_READY
      Reply code 220.
      See Also:
    • SERVICE_CLOSING_CONTROL_CONNECTION

      public static final int SERVICE_CLOSING_CONTROL_CONNECTION
      Reply code 221.
      See Also:
    • DATA_CONNECTION_OPEN

      public static final int DATA_CONNECTION_OPEN
      Reply code 225.
      See Also:
    • CLOSING_DATA_CONNECTION

      public static final int CLOSING_DATA_CONNECTION
      Reply code 226.
      See Also:
    • ENTERING_PASSIVE_MODE

      public static final int ENTERING_PASSIVE_MODE
      Reply code 227.
      See Also:
    • ENTERING_EPSV_MODE

      public static final int ENTERING_EPSV_MODE
      Reply code 229.
      Since:
      2.2
      See Also:
    • USER_LOGGED_IN

      public static final int USER_LOGGED_IN
      Reply code 230.
      See Also:
    • FILE_ACTION_OK

      public static final int FILE_ACTION_OK
      Reply code 250.
      See Also:
    • PATHNAME_CREATED

      public static final int PATHNAME_CREATED
      Reply code 257.
      See Also:
    • NEED_PASSWORD

      public static final int NEED_PASSWORD
      Reply code 331.
      See Also:
    • NEED_ACCOUNT

      public static final int NEED_ACCOUNT
      Reply code 332.
      See Also:
    • FILE_ACTION_PENDING

      public static final int FILE_ACTION_PENDING
      Reply code 350.
      See Also:
    • SERVICE_NOT_AVAILABLE

      public static final int SERVICE_NOT_AVAILABLE
      Reply code 421.
      See Also:
    • CANNOT_OPEN_DATA_CONNECTION

      public static final int CANNOT_OPEN_DATA_CONNECTION
      Reply code 425.
      See Also:
    • TRANSFER_ABORTED

      public static final int TRANSFER_ABORTED
      Reply code 426.
      See Also:
    • FILE_ACTION_NOT_TAKEN

      public static final int FILE_ACTION_NOT_TAKEN
      Reply code 450.
      See Also:
    • ACTION_ABORTED

      public static final int ACTION_ABORTED
      Reply code 451.
      See Also:
    • INSUFFICIENT_STORAGE

      public static final int INSUFFICIENT_STORAGE
      Reply code 452.
      See Also:
    • UNRECOGNIZED_COMMAND

      public static final int UNRECOGNIZED_COMMAND
      Reply code 500.
      See Also:
    • SYNTAX_ERROR_IN_ARGUMENTS

      public static final int SYNTAX_ERROR_IN_ARGUMENTS
      Reply code 501.
      See Also:
    • COMMAND_NOT_IMPLEMENTED

      public static final int COMMAND_NOT_IMPLEMENTED
      Reply code 502.
      See Also:
    • BAD_COMMAND_SEQUENCE

      public static final int BAD_COMMAND_SEQUENCE
      Reply code 503.
      See Also:
    • COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER

      public static final int COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER
      Reply code 504.
      See Also:
    • NOT_LOGGED_IN

      public static final int NOT_LOGGED_IN
      Reply code 530.
      See Also:
    • NEED_ACCOUNT_FOR_STORING_FILES

      public static final int NEED_ACCOUNT_FOR_STORING_FILES
      Reply code 532.
      See Also:
    • FILE_UNAVAILABLE

      public static final int FILE_UNAVAILABLE
      Reply code 550.
      See Also:
    • PAGE_TYPE_UNKNOWN

      public static final int PAGE_TYPE_UNKNOWN
      Reply code 551.
      See Also:
    • STORAGE_ALLOCATION_EXCEEDED

      public static final int STORAGE_ALLOCATION_EXCEEDED
      Reply code 552.
      See Also:
    • FILE_NAME_NOT_ALLOWED

      public static final int FILE_NAME_NOT_ALLOWED
      Reply code 553.
      See Also:
    • SECURITY_DATA_EXCHANGE_COMPLETE

      public static final int SECURITY_DATA_EXCHANGE_COMPLETE
      FTPS reply code 234
      Since:
      2.0
      See Also:
    • SECURITY_DATA_EXCHANGE_SUCCESSFULLY

      public static final int SECURITY_DATA_EXCHANGE_SUCCESSFULLY
      FTPS reply code 235
      Since:
      2.0
      See Also:
    • SECURITY_MECHANISM_IS_OK

      public static final int SECURITY_MECHANISM_IS_OK
      FTPS reply code 334
      Since:
      2.0
      See Also:
    • SECURITY_DATA_IS_ACCEPTABLE

      public static final int SECURITY_DATA_IS_ACCEPTABLE
      FTPS reply code 335
      Since:
      2.0
      See Also:
    • UNAVAILABLE_RESOURCE

      public static final int UNAVAILABLE_RESOURCE
      FTPS reply code 431
      Since:
      2.0
      See Also:
    • BAD_TLS_NEGOTIATION_OR_DATA_ENCRYPTION_REQUIRED

      public static final int BAD_TLS_NEGOTIATION_OR_DATA_ENCRYPTION_REQUIRED
      FTPS reply code 522
      Since:
      2.0
      See Also:
    • DENIED_FOR_POLICY_REASONS

      public static final int DENIED_FOR_POLICY_REASONS
      FTPS reply code 533
      Since:
      2.0
      See Also:
    • REQUEST_DENIED

      public static final int REQUEST_DENIED
      FTPS reply code 534
      Since:
      2.0
      See Also:
    • FAILED_SECURITY_CHECK

      public static final int FAILED_SECURITY_CHECK
      FTPS reply code 535
      Since:
      2.0
      See Also:
    • REQUESTED_PROT_LEVEL_NOT_SUPPORTED

      public static final int REQUESTED_PROT_LEVEL_NOT_SUPPORTED
      FTPS reply code 536
      Since:
      2.0
      See Also:
    • EXTENDED_PORT_FAILURE

      public static final int EXTENDED_PORT_FAILURE
      IPv6 error codes.

      Note this is also used as an FTPS error code reply

      Since:
      2.2
      See Also:
  • Constructor Details

    • FTPReply

      private FTPReply()
      Cannot be instantiated.
  • Method Details

    • isNegativePermanent

      public static boolean isNegativePermanent(int reply)
      Tests 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)
      Tests 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)
      Tests 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 positive completion response, false if not.
    • isPositiveIntermediate

      public static boolean isPositiveIntermediate(int reply)
      Tests 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 multipart 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 positive intermediate response, false if not.
    • isPositivePreliminary

      public static boolean isPositivePreliminary(int reply)
      Tests 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 positive preliminary response, false if not.
    • isProtectedReplyCode

      public static boolean isProtectedReplyCode(int reply)
      Tests if a reply code is a protected response.
      Parameters:
      reply - The reply code to test.
      Returns:
      True if a reply code is a protected response, false if not.
      Since:
      3.0