Package org.globus.ftp.exception
Class FTPException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.globus.ftp.exception.FTPException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ClientException
,DataChannelException
,FTPReplyParseException
,PerfMarkerException
,ServerException
,UnexpectedReplyCodeException
public class FTPException extends java.lang.Exception
Most exceptions used by ftp package are subclasses of FTPException and inherit its features:- exception code can be used to more precisely identify the problem. Exception codes are defined within each exception class (look at the source code). For example, in ClientException, code 8 (ClientException.BAD_MODE) indicates that client refused operation because of bad transfer mode, while code 13 (ClientException.BAD_TYPE) indicates that the same thing was caused by bad transfer type. To programmatically retrieve the exception code, use exception.getCode().
- exception nesting can be used to track the root of the exceptions that come from lower software layers. Use getRootCause().
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Exception
cause
protected int
code
private static java.lang.String[]
codeExplained
protected java.lang.String
customMessage
static int
UNSPECIFIED
-
Constructor Summary
Constructors Constructor Description FTPException(int code)
FTPException(int code, java.lang.String message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCode()
java.lang.String
getCodeExplanation(int code)
java.lang.String
getCustomMessage()
java.lang.String
getMessage()
java.lang.Exception
getRootCause()
Retrieve the nested lower layer exception.void
printStackTrace()
void
printStackTrace(java.io.PrintStream ps)
void
printStackTrace(java.io.PrintWriter pw)
void
setCode(int c)
void
setCustomMessage(java.lang.String m)
void
setRootCause(java.lang.Exception c)
java.lang.String
toString()
-
-
-
Field Detail
-
UNSPECIFIED
public static final int UNSPECIFIED
- See Also:
- Constant Field Values
-
code
protected int code
-
codeExplained
private static java.lang.String[] codeExplained
-
cause
protected java.lang.Exception cause
-
customMessage
protected java.lang.String customMessage
-
-
Method Detail
-
getCodeExplanation
public java.lang.String getCodeExplanation(int code)
-
setRootCause
public void setRootCause(java.lang.Exception c)
-
getRootCause
public java.lang.Exception getRootCause()
Retrieve the nested lower layer exception.
-
setCode
public void setCode(int c)
-
getCode
public int getCode()
-
setCustomMessage
public void setCustomMessage(java.lang.String m)
-
getCustomMessage
public java.lang.String getCustomMessage()
-
getMessage
public java.lang.String getMessage()
- Overrides:
getMessage
in classjava.lang.Throwable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Throwable
-
printStackTrace
public void printStackTrace()
- Overrides:
printStackTrace
in classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintStream ps)
- Overrides:
printStackTrace
in classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintWriter pw)
- Overrides:
printStackTrace
in classjava.lang.Throwable
-
-