org.jets3t.service
Class S3ServiceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.jets3t.service.S3ServiceException
- All Implemented Interfaces:
- Serializable
public class S3ServiceException
- extends Exception
Exception for use by S3Service
s and related utilities.
This exception can hold useful additional information about errors that occur
when communicating with S3.
- Author:
- James Murty
- See Also:
- Serialized Form
S3ServiceException
public S3ServiceException(String message,
String xmlMessage)
- Constructor that includes the XML error document returned by S3.
- Parameters:
message
- xmlMessage
-
S3ServiceException
public S3ServiceException()
S3ServiceException
public S3ServiceException(String message,
Throwable cause)
S3ServiceException
public S3ServiceException(String message)
S3ServiceException
public S3ServiceException(Throwable cause)
toString
public String toString()
- Overrides:
toString
in class Throwable
getS3ErrorCode
public String getS3ErrorCode()
- Returns:
- The service-specific Error Code returned by S3, if an S3 response is available.
For example "AccessDenied", "InternalError"
Null otherwise.
getS3ErrorMessage
public String getS3ErrorMessage()
- Returns:
- The service-specific Error Message returned by S3, if an S3 response is available.
For example: "Access Denied", "We encountered an internal error. Please try again."
getS3ErrorHostId
public String getS3ErrorHostId()
- Returns:
- The Error Host ID returned by S3, if an S3 response is available.
Null otherwise.
getS3ErrorRequestId
public String getS3ErrorRequestId()
- Returns:
- The Error Request ID returned by S3, if an S3 response is available.
Null otherwise.
getXmlMessage
public String getXmlMessage()
- Returns:
- The XML Error message returned by S3, if an S3 response is available.
Null otherwise.
isParsedFromXmlMessage
public boolean isParsedFromXmlMessage()
getResponseCode
public int getResponseCode()
- Returns:
- The HTTP Response Code returned by S3, if an HTTP response is available.
For example: 401, 404, 500
setResponseCode
public void setResponseCode(int responseCode)
getResponseStatus
public String getResponseStatus()
- Returns:
- The HTTP Status message returned by S3, if an HTTP response is available.
For example: "Forbidden", "Not Found", "Internal Server Error"
setResponseStatus
public void setResponseStatus(String responseStatus)
getResponseDate
public String getResponseDate()
setResponseDate
public void setResponseDate(String responseDate)
getRequestVerb
public String getRequestVerb()
- Returns:
- The HTTP Verb used in the request, if available.
For example: "GET", "PUT", "DELETE"
setRequestVerb
public void setRequestVerb(String requestVerb)
getRequestPath
public String getRequestPath()
setRequestPath
public void setRequestPath(String requestPath)
getRequestHost
public String getRequestHost()
setRequestHost
public void setRequestHost(String requestHost)
setS3RequestAndHostIds
public void setS3RequestAndHostIds(String errorRequestId,
String errorHostId)
- Allow the S3 Request and Host Id fields to be populated in situations where
this information is not available from an XML response error document.
If there is no XML error response document, the RequestId and HostId will
generally be available as the HTTP response headers
x-amz-request-id
and x-amz-id-2
respectively.
- Parameters:
errorRequestId
- errorHostId
-
getResponseHeaders
public Map getResponseHeaders()
setResponseHeaders
public void setResponseHeaders(Map s3Headers)