|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.capsd.plugins.FtpResponse
public class FtpResponse
Represents an FTP command response.
| Constructor Summary | |
|---|---|
FtpResponse()
Creates an empty FTP response. |
|
FtpResponse(int code,
String[] response)
Creates an FTP response with given status code and response string. |
|
| Method Summary | |
|---|---|
int |
getCode()
Gets the numeric response code. |
String[] |
getResponse()
Gets the response string array. |
boolean |
isCodeValid()
Does this response have a valid code? |
boolean |
isIntermediate()
Is this response an intermediate message? |
boolean |
isSuccess()
Is this response a successful message? |
static FtpResponse |
readResponse(BufferedReader in)
Reads a server response. |
boolean |
responseContains(String contain)
Search for a text string in each line of the response result. |
static void |
sendCommand(Socket socket,
String command)
Helper method to send commands to the remote server. |
void |
setCode(int code)
Sets the numeric response code. |
void |
setResponse(String[] response)
Sets the response string array. |
String |
toString()
Converts FTP response to string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FtpResponse()
public FtpResponse(int code,
String[] response)
code - numeric status coderesponse - response detail message (one line per array element)| Method Detail |
|---|
public int getCode()
public void setCode(int code)
code - numeric status codepublic String[] getResponse()
public void setResponse(String[] response)
response - response detail message (one line per array element)public boolean responseContains(String contain)
contain - text to search for (using String.contains(contain))
public String toString()
toString in class Objectpublic boolean isCodeValid()
public boolean isSuccess()
public boolean isIntermediate()
public static void sendCommand(Socket socket,
String command)
throws IOException
socket - connection to the servercommand - command to send, without trailing EOL (CRLF, \r\n).
IOException - if we can't write() to the OutputStream for the Socket
public static FtpResponse readResponse(BufferedReader in)
throws IOException
in - input reader
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||