Class FTPReply


  • public final class FTPReply
    extends java.lang.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

    • Method Detail

      • 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.
      • 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.
      • 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.
      • 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.
      • 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