FTP Client

com.amoebacode.ftp
Class FTPServerResponse

java.lang.Object
  extended bycom.amoebacode.ftp.FTPServerResponse

class FTPServerResponse
extends java.lang.Object

FTPServerResponse is a wrapper for FTP server responses, including response codes and text messages.

This class incorporates elements from Bret Taylor's FTPConection.


Field Summary
private  int responseCode
          The numeric code for this response (should be between 100 and 600)
private  java.lang.String responseMessage
          The text message for this response
 
Constructor Summary
protected FTPServerResponse(int responseCode, java.lang.String responseMessage)
          Default protected constructor.
protected FTPServerResponse(java.lang.String fullResponse)
          Protected constructor parses the response code and text message from the full response String.
 
Method Summary
protected  java.lang.String getFullResponse()
          Returns the full FTP server response.
protected  int getResponseCode()
          Returns the numeric code for this response (should be between 100 and 600).
protected  java.lang.String getResponseMessage()
          Returns the text message for this response.
 boolean isActionNotTaken()
          Indicates whether the response code corresponds to an action not taken error.
 boolean isDirectoryExistsError()
          Indicates whether the response code corresponds to a directory exists error.
protected  boolean isPermanentNegative()
          Indicates whether the response code corresponds to a permanent negative response.
protected  boolean isPositiveComplete()
          Indicates whether the response code corresponds to a positive complete response.
protected  boolean isPositiveIntermediate()
          Indicates whether the response code corresponds to a positive preliminary response.
protected  boolean isPositivePreliminary()
          Indicates whether the response code corresponds to a positive preliminary response.
protected  boolean isTransientNegative()
          Indicates whether the response code corresponds to a transient negative response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

responseCode

private int responseCode
The numeric code for this response (should be between 100 and 600)


responseMessage

private java.lang.String responseMessage
The text message for this response

Constructor Detail

FTPServerResponse

protected FTPServerResponse(int responseCode,
                            java.lang.String responseMessage)
Default protected constructor.

Parameters:
responseCode - the numeric response code
responseMessage - the text message

FTPServerResponse

protected FTPServerResponse(java.lang.String fullResponse)
Protected constructor parses the response code and text message from the full response String.

Parameters:
fullResponse - the full FTP server response
Method Detail

getResponseCode

protected int getResponseCode()
Returns the numeric code for this response (should be between 100 and 600).

Returns:
the response code

getResponseMessage

protected java.lang.String getResponseMessage()
Returns the text message for this response.

Returns:
the text message

getFullResponse

protected java.lang.String getFullResponse()
Returns the full FTP server response.

Returns:
the full FTP server response

isPositivePreliminary

protected boolean isPositivePreliminary()
Indicates whether the response code corresponds to a positive preliminary response.


isPositiveIntermediate

protected boolean isPositiveIntermediate()
Indicates whether the response code corresponds to a positive preliminary response.


isPositiveComplete

protected boolean isPositiveComplete()
Indicates whether the response code corresponds to a positive complete response.


isTransientNegative

protected boolean isTransientNegative()
Indicates whether the response code corresponds to a transient negative response.


isPermanentNegative

protected boolean isPermanentNegative()
Indicates whether the response code corresponds to a permanent negative response.


isDirectoryExistsError

public boolean isDirectoryExistsError()
Indicates whether the response code corresponds to a directory exists error.


isActionNotTaken

public boolean isActionNotTaken()
Indicates whether the response code corresponds to an action not taken error.


FTP Client