public final class Response
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
NEGATIVE_PERMANENT
Permanent Negative Completion reply starting code
|
static int |
NEGATIVE_TRANSIENT
Transient Negative Completion reply starting code
|
static int |
POSITIVE_COMPLETION
Positive Completion reply starting code
|
static int |
POSITIVE_INTERMEDIATE
Positive Intermediate reply starting code
|
static int |
POSITIVE_PRELIMINARY
Positive Preliminary reply starting code
|
Constructor and Description |
---|
Response(int code,
java.lang.String text)
Creates a new response instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Checks two responses equality.
|
int |
getCode()
Returns the response code.
|
java.lang.String |
getMessage()
Returns the response message.
|
int |
hashCode()
Returns response hash code.
|
boolean |
isNegative()
Checks if the current response is negative in the meaning of the
possible FTP response codes.
|
boolean |
isPreliminary()
Checks if the current response is preliminary in the meaning of the
possible FTP response codes.
|
static Response |
readFrom(java.io.BufferedReader in)
Reads the FTP response from the input stream.
|
java.lang.String |
toString()
Provides the human-readable response representation.
|
void |
writeTo(java.io.OutputStream out)
Writes the current response to the specified output stream.
|
public static final int POSITIVE_PRELIMINARY
public static final int POSITIVE_COMPLETION
public static final int POSITIVE_INTERMEDIATE
public static final int NEGATIVE_TRANSIENT
public static final int NEGATIVE_PERMANENT
public Response(int code, java.lang.String text)
code
- the response codetext
- the response messagepublic static Response readFrom(java.io.BufferedReader in) throws java.io.IOException, FtpException
in
- the target input streamFtpException
- if an I/O or protocol error occursjava.io.IOException
- if an I/O or protocol error occurspublic int getCode()
public java.lang.String getMessage()
public java.lang.String toString()
toString
in class java.lang.Object
public void writeTo(java.io.OutputStream out) throws java.io.IOException
out
- target output streamjava.io.IOException
- if an I/O error occurspublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- object to checktrue
if both responses are equal;
false
otherwisepublic int hashCode()
hashCode
in class java.lang.Object
public boolean isNegative()
true
if the current response is negative;
false
otherwisepublic boolean isPreliminary()
true
if the current response is preliminary;
false
otherwiseCopyright © JSCAPE LLC. 1999-2021. All Rights Reserved