org.apache.commons.httpclient
Class HttpException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by org.apache.commons.httpclient.HttpException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HttpContentTooLargeException, HttpRecoverableException, ProtocolException, URIException

public class HttpException
extends IOException

Signals that an HTTP or HttpClient exception has occurred.

Version:
$Revision: 1425331 $ $Date: 2012-12-22 18:29:41 +0000 (Sat, 22 Dec 2012) $
Author:
Laura Werner
See Also:
Serialized Form

Constructor Summary
HttpException()
          Creates a new HttpException with a null detail message.
HttpException(String message)
          Creates a new HttpException with the specified detail message.
HttpException(String message, Throwable cause)
          Creates a new HttpException with the specified detail message and cause.
 
Method Summary
 Throwable getCause()
          Return the Throwable that caused this exception, or null if the cause is unavailable, unknown, or not a Throwable.
 String getReason()
          Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.
 int getReasonCode()
          Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.
 void printStackTrace()
          Print this HttpException and its stack trace to the standard error stream.
 void printStackTrace(PrintStream s)
          Print this HttpException and its stack trace to the specified print stream.
 void printStackTrace(PrintWriter s)
          Print this HttpException and its stack trace to the specified print writer.
 void setReason(String reason)
          Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.
 void setReasonCode(int code)
          Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpException

public HttpException()
Creates a new HttpException with a null detail message.


HttpException

public HttpException(String message)
Creates a new HttpException with the specified detail message.

Parameters:
message - the exception detail message

HttpException

public HttpException(String message,
                     Throwable cause)
Creates a new HttpException with the specified detail message and cause.

Parameters:
message - the exception detail message
cause - the Throwable that caused this exception, or null if the cause is unavailable, unknown, or not a Throwable
Since:
3.0
Method Detail

getCause

public Throwable getCause()
Return the Throwable that caused this exception, or null if the cause is unavailable, unknown, or not a Throwable.

Overrides:
getCause in class Throwable
Returns:
the Throwable that caused this exception, or null if the cause is unavailable, unknown, or not a Throwable
Since:
3.0

printStackTrace

public void printStackTrace()
Print this HttpException and its stack trace to the standard error stream.

Overrides:
printStackTrace in class Throwable
Since:
3.0

printStackTrace

public void printStackTrace(PrintStream s)
Print this HttpException and its stack trace to the specified print stream.

Overrides:
printStackTrace in class Throwable
Parameters:
s - the PrintStream to which the exception and its stack trace should be written
Since:
3.0

printStackTrace

public void printStackTrace(PrintWriter s)
Print this HttpException and its stack trace to the specified print writer.

Overrides:
printStackTrace in class Throwable
Parameters:
s - the PrintWriter to which the exception and its stack trace should be written
Since:
3.0

setReason

public void setReason(String reason)
Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.

Sets the text description of the reason for an exception.

Parameters:
reason - The reason for the exception.

getReason

public String getReason()
Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.

Get the text description of the reason for an exception.


setReasonCode

public void setReasonCode(int code)
Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.

Sets the status code description of the reason for an exception.

Parameters:
code - The reason for the exception. This is intended to be an HTTP status code.

getReasonCode

public int getReasonCode()
Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.

Get the status code description of the reason for an exception.



Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.