edu.harvard.cfa.vo.tapclient.util
Class HttpException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by edu.harvard.cfa.vo.tapclient.util.HttpException
All Implemented Interfaces:
java.io.Serializable

public class HttpException
extends java.io.IOException

An exception used to indicate a service responded with an unexpected HTTP response code.

See Also:
Serialized Form

Constructor Summary
HttpException(int statusCode)
          Construct an HttpException object from the given HTTP status code.
HttpException(java.lang.String message)
          Construct an HttpException object from the given HTTP status code.
HttpException(java.lang.String message, int statusCode)
          Construct an HttpException object from the given HTTP status code.
HttpException(java.lang.String message, int statusCode, java.lang.String content)
          Construct an HttpException object from the given HTTP status code.
HttpException(java.lang.String message, java.lang.Throwable cause)
          Construct an HttpException object from the given HTTP status code.
HttpException(java.lang.Throwable cause)
          Construct an HttpException object from the given HTTP status code.
 
Method Summary
 java.lang.String getContent()
          Get the HTTP response content.
 int getStatusCode()
          Get the HTTP Status Code.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpException

public HttpException(int statusCode)
Construct an HttpException object from the given HTTP status code. The detail message is set to a default string for the given status code.

Parameters:
statusCode - the HTTP status code, for example 404 for requests that are not found.

HttpException

public HttpException(java.lang.String message)
Construct an HttpException object from the given HTTP status code. The detail message is set to a default string for the given status code.

Parameters:
message - the detail message string of this HttpException. If null, it defaults to a string representation of the status code.

HttpException

public HttpException(java.lang.String message,
                     int statusCode)
Construct an HttpException object from the given HTTP status code. The detail message is set to a default string for the given status code.

Parameters:
message - the detail message string of this HttpException. If null, it defaults to a string representation of the status code.
statusCode - the HTTP status code, for example 404 for requests that are not found.

HttpException

public HttpException(java.lang.String message,
                     int statusCode,
                     java.lang.String content)
Construct an HttpException object from the given HTTP status code. The detail message is set to a default string for the given status code.

Parameters:
message - the detail message string of this HttpException. If null, it defaults to a string representation of the status code.
statusCode - the HTTP status code, for example 404 for requests that are not found.
content - the HTTP response body content

HttpException

public HttpException(java.lang.String message,
                     java.lang.Throwable cause)
Construct an HttpException object from the given HTTP status code. The detail message is set to a default string for the given status code.

Parameters:
message - the detail message string of this HttpException. If null, it defaults to a string representation of the status code.
cause - the cause of the exception.

HttpException

public HttpException(java.lang.Throwable cause)
Construct an HttpException object from the given HTTP status code. The detail message is set to a default string for the given status code.

Parameters:
cause - the cause of the exception.
Method Detail

getStatusCode

public int getStatusCode()
Get the HTTP Status Code.

Returns:
the HTTP Status Code

getContent

public java.lang.String getContent()
Get the HTTP response content.

Returns:
the HTTP response content