Overview | Package | Class | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.amazonaws.services.s3.model
Class GeneratePresignedUrlRequest

    java.lang.Object
      com.amazonaws.AmazonWebServiceRequest
          com.amazonaws.services.s3.model.GeneratePresignedUrlRequest

    public class GeneratePresignedUrlRequest

extends AmazonWebServiceRequest

A request to pre-sign a 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, then pass that pre-signed URL around for other people to access the resource without providing them access to an account's AWS security credentials.

See Also:
  `AmazonS3.generatePresignedUrl(GeneratePresignedUrlRequest)`

Constructor Summary
`GeneratePresignedUrlRequest(String bucketName, 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(String bucketName, 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.

Method Summary
`void` | `addRequestParameter(String key, String value)` Adds an additional request parameter to be included in the pre-signed URL.
`String` | `getBucketName()` Returns the name of the bucket involved in this request.
`Date` | `getExpiration()` The expiration date at which point the new pre-signed URL will no longer be accepted by Amazon S3.
`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.
`Map<String,String>` | `getRequestParameters()` Returns the complete map of additional request parameters to be included in the pre-signed URL.
`void` | `setBucketName(String bucketName)` Sets the name of the bucket involved in this request.
`void` | `setExpiration(Date expiration)` Sets the expiration date at which point the new pre-signed URL will no longer be accepted by Amazon S3.
`void` | `setKey(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.
`GeneratePresignedUrlRequest` | `withBucketName(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` | `withExpiration(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(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.

Methods inherited from class com.amazonaws.AmazonWebServiceRequest
`copyPrivateRequestParameters`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GeneratePresignedUrlRequest

    public GeneratePresignedUrlRequest(String bucketName,
                                       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.

  Parameters:
    `bucketName` - The name of the bucket containing the desired Amazon S3 object.
    `key` - The key under which the desired Amazon S3 object is stored.

### GeneratePresignedUrlRequest

    public GeneratePresignedUrlRequest(String bucketName,
                                       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.

  Parameters:
    `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.

Method Detail

### getMethod

    public HttpMethod getMethod()

  The HTTP method (GET, PUT, DELETE, HEAD) to be used in this request. The same HTTP method must be used in the request when the pre-signed URL is used.

  Returns:
    The HTTP method (GET, PUT, DELETE, HEAD) to be used in this request and when the pre-signed URL is used.

### setMethod

    public void setMethod(HttpMethod method)

  Sets the HTTP method (GET, PUT, DELETE, HEAD) to be used in this request. The same HTTP method must be used in the request when the pre-signed URL is used.

  Parameters:
    `method` - The HTTP method (GET, PUT, DELETE, HEAD) to be used in this request.

### withMethod

    public 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.

  The same HTTP method must be used in the request when the pre-signed URL is used.

  Parameters:
    `method` - The HTTP method (GET, PUT, DELETE, HEAD) to be used in this request.
  Returns:
    The updated request object, so that additional method calls can be chained together.

### getBucketName

    public String getBucketName()

  Returns the name of the bucket involved in this request.

  Returns:
    the name of the bucket involved in this request.

### setBucketName

    public void setBucketName(String bucketName)

  Sets the name of the bucket involved in this request.

  Parameters:
    `bucketName` - the name of the bucket involved in this request.

### withBucketName

    public GeneratePresignedUrlRequest withBucketName(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.

  Parameters:
    `bucketName` - the name of the bucket involved in this request.
  Returns:
    The updated request object, so that additional method calls can be chained together.

### getKey

    public String getKey()

  Returns the key of the object involved in this request.

  Returns:
    The key of the object involved in this request.

### setKey

    public void setKey(String key)

  Sets the key of the object involved in this request.

  Parameters:
    `key` - the key of the object involved in this request.

### withKey

    public GeneratePresignedUrlRequest withKey(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.

  Parameters:
    `key` - the key of the object involved in this request.
  Returns:
    The updated request object, so that additional method calls can be chained together.

### getExpiration

    public Date getExpiration()

  The expiration date at which point the new pre-signed URL will no longer be accepted by Amazon S3. If not specified, a default value will be supplied.

  Returns:
    The expiration date at which point the new pre-signed URL will no longer be accepted by Amazon S3.

### setExpiration

    public void setExpiration(Date expiration)

  Sets the expiration date at which point the new pre-signed URL will no longer be accepted by Amazon S3. If not specified, a default value will be supplied.

  Parameters:
    `expiration` - The expiration date at which point the new pre-signed URL will no longer be accepted by Amazon S3.

### withExpiration

    public GeneratePresignedUrlRequest withExpiration(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.

  If not specified, a default value will be supplied.

  Parameters:
    `expiration` - The expiration date at which point the new pre-signed URL will no longer be accepted by Amazon S3.
  Returns:
    The updated request object, so that additional method calls can be chained together.

### addRequestParameter

    public void addRequestParameter(String key,
                                    String value)

  Adds an additional request parameter to be included in the pre-signed URL. Adding additional request parameters enables more advanced pre-signed URLs, such as accessing Amazon S3's torrent resource for an object, or for specifying a version ID when accessing an object.

  Parameters:
    `key` - The name of the request parameter, as it appears in the URL's query string (ex: versionId).
    `value` - The (optional) value of the request parameter being added.

### getRequestParameters

    public Map<String,String> getRequestParameters()

  Returns the complete map of additional request parameters to be included in the pre-signed URL.

  Returns:
    The complete map of additional request parameters to be included in the pre-signed URL.

Overview | Package | Class | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.