org.exolab.adaptx.util

Class NestedIOException

public class NestedIOException extends IOException

An exception that is used to signal I/O errors which are caused by other exceptions. This class allows the user get to the original exception.

Version: $Revision: 3633 $ $Date: 2003-03-01 02:38:44 -0500 (Sat, 01 Mar 2003) $

Author: Keith Visco

Constructor Summary
NestedIOException()
Creates a new NestedIOException with no message, or nested Exception
NestedIOException(String message)
Creates a new NestedIOException with the given message.
NestedIOException(Exception exception)
Creates a new NestedIOException with the given nested exception.
NestedIOException(String message, Exception exception)
Creates a new NestedIOException with the given message and nested exception.
Method Summary
ExceptiongetException()
Returns the exception, which in turn caused this Exception to be thrown, or null if nested exception exists.
voidprintStackTrace()
voidprintStackTrace(PrintWriter printer)
voidprintStackTrace(PrintStream printer)
voidsetLocalStackTraceOnly(boolean localTrace)
Sets whether or not to print the local stack trace or the nested stack trace when calls to #printStackTrace are made.
StringtoString()
Returns the String representation of this Exception.

Constructor Detail

NestedIOException

public NestedIOException()
Creates a new NestedIOException with no message, or nested Exception

NestedIOException

public NestedIOException(String message)
Creates a new NestedIOException with the given message.

Parameters: message the message for this Exception

NestedIOException

public NestedIOException(Exception exception)
Creates a new NestedIOException with the given nested exception.

Parameters: exception the nested exception. (Must not be null).

NestedIOException

public NestedIOException(String message, Exception exception)
Creates a new NestedIOException with the given message and nested exception.

Parameters: message the detail message for this exception exception the nested exception

Method Detail

getException

public Exception getException()
Returns the exception, which in turn caused this Exception to be thrown, or null if nested exception exists.

Returns: the exception, which in turn caused this Exception to be thrown, or null if nested exception exists.

printStackTrace

public void printStackTrace()

printStackTrace

public void printStackTrace(PrintWriter printer)

printStackTrace

public void printStackTrace(PrintStream printer)

setLocalStackTraceOnly

public void setLocalStackTraceOnly(boolean localTrace)
Sets whether or not to print the local stack trace or the nested stack trace when calls to #printStackTrace are made. By default the nested exception is used for printing stack trace.

Parameters: localTrace a boolean when true enables local stack trace only.

toString

public String toString()
Returns the String representation of this Exception.

Returns: the String representation of this Exception.