public class GeneratePresignedUrlRequest extends AmazonWebServiceRequest
Contains options to genearate a pre-signed URL for an Amazon S3 resource.
Pre-signed URLs allow clients to form a URL for an Amazon S3 resource and sign it with the current AWS security credentials. A pre-signed URL may be passed around for other users to access the resource without providing them access to an account's AWS security credentials.
| コンストラクタと説明 |
|---|
GeneratePresignedUrlRequest(java.lang.String bucketName,
java.lang.String key)
Creates a new request for generating a pre-signed URL that can be used as
part of an HTTP GET request to access the Amazon S3 object stored under
the specified key in the specified bucket.
|
GeneratePresignedUrlRequest(java.lang.String bucketName,
java.lang.String key,
HttpMethod method)
Creates a new request for generating a pre-signed URL that can be used as
part of an HTTP request to access the specified Amazon S3 resource.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
addRequestParameter(java.lang.String key,
java.lang.String value)
Adds an additional request parameter to be included in the pre-signed
URL.
|
java.lang.String |
getBucketName()
Returns the name of the bucket involved in this request.
|
java.lang.String |
getContentType()
Gets the expected content-type of the request.
|
java.util.Date |
getExpiration()
The expiration date at which point the new pre-signed URL will no longer
be accepted by Amazon S3.
|
java.lang.String |
getKey()
Returns the key of the object involved in this request.
|
HttpMethod |
getMethod()
The HTTP method (GET, PUT, DELETE, HEAD) to be used in this request.
|
java.util.Map<java.lang.String,java.lang.String> |
getRequestParameters()
Returns the complete map of additional request parameters to be included
in the pre-signed URL.
|
ResponseHeaderOverrides |
getResponseHeaders()
Returns the headers to be overridden in the service response.
|
void |
setBucketName(java.lang.String bucketName)
Sets the name of the bucket involved in this request.
|
void |
setContentType(java.lang.String contentType)
Sets the expected content-type of the request.
|
void |
setExpiration(java.util.Date expiration)
Sets the expiration date at which point the new pre-signed URL will no
longer be accepted by Amazon S3.
|
void |
setKey(java.lang.String key)
Sets the key of the object involved in this request.
|
void |
setMethod(HttpMethod method)
Sets the HTTP method (GET, PUT, DELETE, HEAD) to be used in this request.
|
void |
setResponseHeaders(ResponseHeaderOverrides responseHeaders)
Sets the headers to be overridden in the service response.
|
GeneratePresignedUrlRequest |
withBucketName(java.lang.String bucketName)
Sets the name of the bucket involved in this request, and returns this
request object to enable additional method calls to be chained together.
|
GeneratePresignedUrlRequest |
withContentType(java.lang.String contentType)
Sets the expected content-type of the request and returns
this object, for method chaining.
|
GeneratePresignedUrlRequest |
withExpiration(java.util.Date expiration)
Sets the expiration date at which point the new pre-signed URL will no
longer be accepted by Amazon S3, and returns this request object to
enable additional method calls to be chained together.
|
GeneratePresignedUrlRequest |
withKey(java.lang.String key)
Sets the key of the object involved in this request, and returns this
request object to enable additional method calls to be chained together.
|
GeneratePresignedUrlRequest |
withMethod(HttpMethod method)
Sets the HTTP method (GET, PUT, DELETE, HEAD) to be used in this request,
and returns this request object to enable additional method calls to be
chained together.
|
GeneratePresignedUrlRequest |
withResponseHeaders(ResponseHeaderOverrides responseHeaders)
Sets the headers to be overridden in the service response and returns
this object, for method chaining.
|
copyPrivateRequestParameters, getRequestClientOptions, getRequestCredentials, setRequestCredentialspublic GeneratePresignedUrlRequest(java.lang.String bucketName,
java.lang.String key)
bucketName - The name of the bucket containing the desired Amazon S3
object.key - The key under which the desired Amazon S3 object is stored.public GeneratePresignedUrlRequest(java.lang.String bucketName,
java.lang.String key,
HttpMethod method)
Creates a new request for generating a pre-signed URL that can be used as part of an HTTP request to access the specified Amazon S3 resource.
When specifying an HTTP method, you must send the pre-signed URL with the same HTTP method in order to successfully use the pre-signed URL.
bucketName - The name of the Amazon S3 bucket involved in the operation.key - The key of the Amazon S3 object involved in the operation.method - The HTTP method (GET, PUT, DELETE, HEAD) to be used in the
request when the pre-signed URL is used.public HttpMethod getMethod()
public void setMethod(HttpMethod method)
method - The HTTP method (GET, PUT, DELETE, HEAD) to be used in this
request.public GeneratePresignedUrlRequest withMethod(HttpMethod method)
The same HTTP method must be used in the request when the pre-signed URL is used.
method - The HTTP method (GET, PUT, DELETE, HEAD) to be used in this
request.public java.lang.String getBucketName()
public void setBucketName(java.lang.String bucketName)
bucketName - the name of the bucket involved in this request.public GeneratePresignedUrlRequest withBucketName(java.lang.String bucketName)
bucketName - the name of the bucket involved in this request.public java.lang.String getKey()
public void setKey(java.lang.String key)
key - the key of the object involved in this request.public GeneratePresignedUrlRequest withKey(java.lang.String key)
key - the key of the object involved in this request.public java.util.Date getExpiration()
public void setExpiration(java.util.Date expiration)
expiration - The expiration date at which point the new pre-signed URL will
no longer be accepted by Amazon S3.public GeneratePresignedUrlRequest withExpiration(java.util.Date expiration)
If not specified, a default value will be supplied.
expiration - The expiration date at which point the new pre-signed URL will
no longer be accepted by Amazon S3.public void addRequestParameter(java.lang.String key,
java.lang.String value)
key - The name of the request parameter, as it appears in the URL's
query string (e.g. versionId).value - The (optional) value of the request parameter being added.public java.util.Map<java.lang.String,java.lang.String> getRequestParameters()
public ResponseHeaderOverrides getResponseHeaders()
public void setResponseHeaders(ResponseHeaderOverrides responseHeaders)
responseHeaders - The headers to be overridden in the service response.public GeneratePresignedUrlRequest withResponseHeaders(ResponseHeaderOverrides responseHeaders)
responseHeaders - The headers to be overridden in the service response.GeneratePresignedUrlRequest for method chaining.public java.lang.String getContentType()
public void setContentType(java.lang.String contentType)
contentType - The expected content-typepublic GeneratePresignedUrlRequest withContentType(java.lang.String contentType)
contentType - The expected content-typeGeneratePresignedUrlRequest for method chaining.