public class AmazonS3ExceptionBuilder
extends java.lang.Object
AmazonS3Exception
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.String> |
additionalDetails
Additional information on the exception.
|
private java.lang.String |
cloudFrontId
An accelerate mode specific ID sent from CloudFront that provides additional debugging information.
|
private java.lang.String |
errorCode
The AWS error code represented by this exception (ex:
InvalidParameterValue).
|
private java.lang.String |
errorMessage
The error message as returned by the service.
|
private java.lang.String |
errorResponseXml
Returns the error XML received in the HTTP Response or null if the
exception is constructed from the headers.
|
private java.lang.String |
extendedRequestId
An S3 specific request ID that provides additional debugging information.
|
private java.lang.String |
requestId
The unique AWS identifier for the service request the caller made.
|
private int |
statusCode
The HTTP status code that was returned with this error
|
Constructor and Description |
---|
AmazonS3ExceptionBuilder() |
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalDetail(java.lang.String key,
java.lang.String detail)
Adds an entry to the additional information map.
|
AmazonS3Exception |
build()
Creates a new AmazonS3Exception object with the values set.
|
private AmazonServiceException.ErrorType |
errorTypeOf(int statusCode)
Returns the AWS error type information by looking at the HTTP status code
in the error response.
|
java.util.Map<java.lang.String,java.lang.String> |
getAdditionalDetails()
Returns any additional information retrieved in the error response.
|
java.lang.String |
getCloudFrontId()
Gets Amazon S3's CloudFront ID when the request is performed in the accelerate mode.
|
java.lang.String |
getErrorCode()
Returns the AWS error code represented by this exception.
|
java.lang.String |
getErrorMessage()
Returns the human-readable error message provided by the service
|
java.lang.String |
getErrorResponseXml()
Returns the original error response XML received from Amazon S3
|
java.lang.String |
getExtendedRequestId()
Gets Amazon S3's extended request ID.
|
java.lang.String |
getRequestId()
Returns the AWS request ID that uniquely identifies the service request
the caller made.
|
int |
getStatusCode()
Returns the HTTP status code that was returned with this service
exception.
|
void |
setAdditionalDetails(java.util.Map<java.lang.String,java.lang.String> additionalDetails)
Sets additional information about the response.
|
void |
setCloudFrontId(java.lang.String cloudFrontId)
Sets Amazon S3's CloudFront ID when the request is performed in the accelerate mode.
|
void |
setErrorCode(java.lang.String errorCode)
Sets the AWS error code represented by this exception.
|
void |
setErrorMessage(java.lang.String errorMessage)
Sets the human-readable error message provided by the service
|
void |
setErrorResponseXml(java.lang.String errorResponseXml)
Sets the error response XML received from Amazon S3
|
void |
setExtendedRequestId(java.lang.String extendedRequestId)
Sets Amazon S3's extended request ID.
|
void |
setRequestId(java.lang.String requestId)
Sets the AWS requestId for this exception.
|
void |
setStatusCode(int statusCode)
Sets the HTTP status code that was returned with this service exception.
|
private java.lang.String requestId
private java.lang.String errorCode
private java.lang.String errorMessage
private int statusCode
private java.lang.String extendedRequestId
private java.lang.String cloudFrontId
private java.util.Map<java.lang.String,java.lang.String> additionalDetails
private java.lang.String errorResponseXml
public java.lang.String getRequestId()
public void setRequestId(java.lang.String requestId)
requestId
- The unique identifier for the service request the caller made.public void setErrorCode(java.lang.String errorCode)
errorCode
- The AWS error code represented by this exception.public java.lang.String getErrorCode()
public java.lang.String getErrorMessage()
public void setErrorMessage(java.lang.String errorMessage)
public void setStatusCode(int statusCode)
statusCode
- The HTTP status code that was returned with this service
exception.public int getStatusCode()
public java.lang.String getExtendedRequestId()
AmazonS3Exception.setExtendedRequestId(String)
,
AmazonS3Exception.getExtendedRequestId()
public void setExtendedRequestId(java.lang.String extendedRequestId)
extendedRequestId
- S3's extended request ID.AmazonS3Exception.setExtendedRequestId(String)
,
AmazonS3Exception.getExtendedRequestId()
public java.lang.String getCloudFrontId()
public void setCloudFrontId(java.lang.String cloudFrontId)
cloudFrontId
- Amazon S3's CloudFront ID.public java.util.Map<java.lang.String,java.lang.String> getAdditionalDetails()
public void setAdditionalDetails(java.util.Map<java.lang.String,java.lang.String> additionalDetails)
public void addAdditionalDetail(java.lang.String key, java.lang.String detail)
public java.lang.String getErrorResponseXml()
public void setErrorResponseXml(java.lang.String errorResponseXml)
public AmazonS3Exception build()
private AmazonServiceException.ErrorType errorTypeOf(int statusCode)
httpResponse
- The HTTP error response to use to determine the right error
type to set.