Class NestedIOException

  • All Implemented Interfaces:
    java.io.Serializable

    public class NestedIOException
    extends java.io.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 08:38:44 +0100 (Sat, 01 Mar 2003) $
    Author:
    Keith Visco
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      NestedIOException()
      Creates a new NestedIOException with no message, or nested Exception
      NestedIOException​(java.lang.Exception exception)
      Creates a new NestedIOException with the given nested exception.
      NestedIOException​(java.lang.String message)
      Creates a new NestedIOException with the given message.
      NestedIOException​(java.lang.String message, java.lang.Exception exception)
      Creates a new NestedIOException with the given message and nested exception.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Exception getException()
      Returns the exception, which in turn caused this Exception to be thrown, or null if nested exception exists.
      void printStackTrace()  
      void printStackTrace​(java.io.PrintStream printer)  
      void printStackTrace​(java.io.PrintWriter printer)  
      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.
      java.lang.String toString()
      Returns the String representation of this Exception.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NestedIOException

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

        public NestedIOException​(java.lang.String message)
        Creates a new NestedIOException with the given message.
        Parameters:
        message - the message for this Exception
      • NestedIOException

        public NestedIOException​(java.lang.Exception exception)
        Creates a new NestedIOException with the given nested exception.
        Parameters:
        exception - the nested exception. (Must not be null).
      • NestedIOException

        public NestedIOException​(java.lang.String message,
                                 java.lang.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 java.lang.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.
      • 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 java.lang.String toString()
        Returns the String representation of this Exception.
        Overrides:
        toString in class java.lang.Throwable
        Returns:
        the String representation of this Exception.
      • printStackTrace

        public void printStackTrace()
        Overrides:
        printStackTrace in class java.lang.Throwable
      • printStackTrace

        public void printStackTrace​(java.io.PrintWriter printer)
        Overrides:
        printStackTrace in class java.lang.Throwable
      • printStackTrace

        public void printStackTrace​(java.io.PrintStream printer)
        Overrides:
        printStackTrace in class java.lang.Throwable