gnu.inet.ftp
Class ServerResponseException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--gnu.inet.ftp.ServerResponseException
All Implemented Interfaces:
java.io.Serializable

public class ServerResponseException
extends java.lang.Exception

See Also:
Serialized Form

Constructor Summary
ServerResponseException(java.lang.String str)
          basic constructor.
 
Method Summary
 long getCode()
          get the server response code.
 java.lang.String getMessage()
          get the server message.
 java.lang.String toString()
          get a string representing this ServerResponseException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerResponseException

public ServerResponseException(java.lang.String str)
basic constructor. creates a new ServerResponseException given the server error message. The input string must be in the format of 3 digits, a space and the error message. This is the default format of the server responses.
Parameters:
str - the server error message in the form
Method Detail

getCode

public long getCode()
             throws java.lang.NumberFormatException
get the server response code.
Returns:
server response code as long value
Throws:
java.lang.NumberFormatException - the first 3 characters of the message are not a number as they should be in a normal server response

getMessage

public java.lang.String getMessage()
get the server message.
Overrides:
getMessage in class java.lang.Throwable
Returns:
the full server response message string

toString

public java.lang.String toString()
get a string representing this ServerResponseException
Overrides:
toString in class java.lang.Throwable
Returns:
this ServerResponseException as a String