org.apache.commons.net.ftp

## 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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ACTION_ABORTED`
    `static int` | `BAD_COMMAND_SEQUENCE`
    `static int` | `BAD_TLS_NEGOTIATION_OR_DATA_ENCRYPTION_REQUIRED`
    `static int` | `CANNOT_OPEN_DATA_CONNECTION`
    `static int` | `CLOSING_DATA_CONNECTION`
    `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` | `DENIED_FOR_POLICY_REASONS`
    `static int` | `DIRECTORY_STATUS`
    `static int` | `ENTERING_EPSV_MODE`
    `static int` | `ENTERING_PASSIVE_MODE`
    `static int` | `EXTENDED_PORT_FAILURE`
    `static int` | `FAILED_SECURITY_CHECK`
    `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` | `REQUEST_DENIED`
    `static int` | `REQUESTED_PROT_LEVEL_NOT_SUPPORTED`
    `static int` | `RESTART_MARKER`
    `static int` | `SECURITY_DATA_EXCHANGE_COMPLETE`
    `static int` | `SECURITY_DATA_EXCHANGE_SUCCESSFULLY`
    `static int` | `SECURITY_DATA_IS_ACCEPTABLE`
    `static int` | `SECURITY_MECHANISM_IS_OK`
    `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` | `UNAVAILABLE_RESOURCE`
    `static int` | `UNRECOGNIZED_COMMAND`
    `static int` | `USER_LOGGED_IN`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `static boolean` | `isProtectedReplyCode(int reply)` Determine if a reply code is a protected response.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### RESTART_MARKER

          public static final int RESTART_MARKER

      See Also:
        Constant Field Values

    - #### SERVICE_NOT_READY

          public static final int SERVICE_NOT_READY

      See Also:
        Constant Field Values

    - #### DATA_CONNECTION_ALREADY_OPEN

          public static final int DATA_CONNECTION_ALREADY_OPEN

      See Also:
        Constant Field Values

    - #### FILE_STATUS_OK

          public static final int FILE_STATUS_OK

      See Also:
        Constant Field Values

    - #### COMMAND_OK

          public static final int COMMAND_OK

      See Also:
        Constant Field Values

    - #### COMMAND_IS_SUPERFLUOUS

          public static final int COMMAND_IS_SUPERFLUOUS

      See Also:
        Constant Field Values

    - #### SYSTEM_STATUS

          public static final int SYSTEM_STATUS

      See Also:
        Constant Field Values

    - #### DIRECTORY_STATUS

          public static final int DIRECTORY_STATUS

      See Also:
        Constant Field Values

    - #### FILE_STATUS

          public static final int FILE_STATUS

      See Also:
        Constant Field Values

    - #### HELP_MESSAGE

          public static final int HELP_MESSAGE

      See Also:
        Constant Field Values

    - #### NAME_SYSTEM_TYPE

          public static final int NAME_SYSTEM_TYPE

      See Also:
        Constant Field Values

    - #### SERVICE_READY

          public static final int SERVICE_READY

      See Also:
        Constant Field Values

    - #### SERVICE_CLOSING_CONTROL_CONNECTION

          public static final int SERVICE_CLOSING_CONTROL_CONNECTION

      See Also:
        Constant Field Values

    - #### DATA_CONNECTION_OPEN

          public static final int DATA_CONNECTION_OPEN

      See Also:
        Constant Field Values

    - #### CLOSING_DATA_CONNECTION

          public static final int CLOSING_DATA_CONNECTION

      See Also:
        Constant Field Values

    - #### ENTERING_PASSIVE_MODE

          public static final int ENTERING_PASSIVE_MODE

      See Also:
        Constant Field Values

    - #### ENTERING_EPSV_MODE

          public static final int ENTERING_EPSV_MODE

      Since:
        2.2
      See Also:
        Constant Field Values

    - #### USER_LOGGED_IN

          public static final int USER_LOGGED_IN

      See Also:
        Constant Field Values

    - #### FILE_ACTION_OK

          public static final int FILE_ACTION_OK

      See Also:
        Constant Field Values

    - #### PATHNAME_CREATED

          public static final int PATHNAME_CREATED

      See Also:
        Constant Field Values

    - #### NEED_PASSWORD

          public static final int NEED_PASSWORD

      See Also:
        Constant Field Values

    - #### NEED_ACCOUNT

          public static final int NEED_ACCOUNT

      See Also:
        Constant Field Values

    - #### FILE_ACTION_PENDING

          public static final int FILE_ACTION_PENDING

      See Also:
        Constant Field Values

    - #### SERVICE_NOT_AVAILABLE

          public static final int SERVICE_NOT_AVAILABLE

      See Also:
        Constant Field Values

    - #### CANNOT_OPEN_DATA_CONNECTION

          public static final int CANNOT_OPEN_DATA_CONNECTION

      See Also:
        Constant Field Values

    - #### TRANSFER_ABORTED

          public static final int TRANSFER_ABORTED

      See Also:
        Constant Field Values

    - #### FILE_ACTION_NOT_TAKEN

          public static final int FILE_ACTION_NOT_TAKEN

      See Also:
        Constant Field Values

    - #### ACTION_ABORTED

          public static final int ACTION_ABORTED

      See Also:
        Constant Field Values

    - #### INSUFFICIENT_STORAGE

          public static final int INSUFFICIENT_STORAGE

      See Also:
        Constant Field Values

    - #### UNRECOGNIZED_COMMAND

          public static final int UNRECOGNIZED_COMMAND

      See Also:
        Constant Field Values

    - #### SYNTAX_ERROR_IN_ARGUMENTS

          public static final int SYNTAX_ERROR_IN_ARGUMENTS

      See Also:
        Constant Field Values

    - #### COMMAND_NOT_IMPLEMENTED

          public static final int COMMAND_NOT_IMPLEMENTED

      See Also:
        Constant Field Values

    - #### BAD_COMMAND_SEQUENCE

          public static final int BAD_COMMAND_SEQUENCE

      See Also:
        Constant Field Values

    - #### COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER

          public static final int COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER

      See Also:
        Constant Field Values

    - #### NOT_LOGGED_IN

          public static final int NOT_LOGGED_IN

      See Also:
        Constant Field Values

    - #### NEED_ACCOUNT_FOR_STORING_FILES

          public static final int NEED_ACCOUNT_FOR_STORING_FILES

      See Also:
        Constant Field Values

    - #### FILE_UNAVAILABLE

          public static final int FILE_UNAVAILABLE

      See Also:
        Constant Field Values

    - #### PAGE_TYPE_UNKNOWN

          public static final int PAGE_TYPE_UNKNOWN

      See Also:
        Constant Field Values

    - #### STORAGE_ALLOCATION_EXCEEDED

          public static final int STORAGE_ALLOCATION_EXCEEDED

      See Also:
        Constant Field Values

    - #### FILE_NAME_NOT_ALLOWED

          public static final int FILE_NAME_NOT_ALLOWED

      See Also:
        Constant Field Values

    - #### SECURITY_DATA_EXCHANGE_COMPLETE

          public static final int SECURITY_DATA_EXCHANGE_COMPLETE

      Since:
        2.0
      See Also:
        Constant Field Values

    - #### SECURITY_DATA_EXCHANGE_SUCCESSFULLY

          public static final int SECURITY_DATA_EXCHANGE_SUCCESSFULLY

      Since:
        2.0
      See Also:
        Constant Field Values

    - #### SECURITY_MECHANISM_IS_OK

          public static final int SECURITY_MECHANISM_IS_OK

      Since:
        2.0
      See Also:
        Constant Field Values

    - #### SECURITY_DATA_IS_ACCEPTABLE

          public static final int SECURITY_DATA_IS_ACCEPTABLE

      Since:
        2.0
      See Also:
        Constant Field Values

    - #### UNAVAILABLE_RESOURCE

          public static final int UNAVAILABLE_RESOURCE

      Since:
        2.0
      See Also:
        Constant Field Values

    - #### BAD_TLS_NEGOTIATION_OR_DATA_ENCRYPTION_REQUIRED

          public static final int BAD_TLS_NEGOTIATION_OR_DATA_ENCRYPTION_REQUIRED

      Since:
        2.2
      See Also:
        Constant Field Values

    - #### DENIED_FOR_POLICY_REASONS

          public static final int DENIED_FOR_POLICY_REASONS

      Since:
        2.0
      See Also:
        Constant Field Values

    - #### REQUEST_DENIED

          public static final int REQUEST_DENIED

      Since:
        2.0
      See Also:
        Constant Field Values

    - #### FAILED_SECURITY_CHECK

          public static final int FAILED_SECURITY_CHECK

      Since:
        2.0
      See Also:
        Constant Field Values

    - #### REQUESTED_PROT_LEVEL_NOT_SUPPORTED

          public static final int REQUESTED_PROT_LEVEL_NOT_SUPPORTED

      Since:
        2.0
      See Also:
        Constant Field Values

    - #### EXTENDED_PORT_FAILURE

          public static final int EXTENDED_PORT_FAILURE

      Since:
        2.2
      See Also:
        Constant Field Values

  - ### 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 positive 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 positive 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 positive preliminary response, false if not.

    - #### isProtectedReplyCode

          public static boolean isProtectedReplyCode(int reply)

      Determine 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

Copyright © 2001–2022 The Apache Software Foundation. All rights reserved.