com.aliyun.oss.model

## 类 GeneratePresignedUrlRequest

- java.lang.Object
- - com.aliyun.oss.model.GeneratePresignedUrlRequest

-     public class GeneratePresignedUrlRequest
      extends Object

  This class wraps all the information needed to generate a presigned URl. And it's not the real "request" class.

- - ### 构造器概要

    构造器
    构造器和说明
    `GeneratePresignedUrlRequest(String bucketName, String key)` Constructor with GET as the httpMethod
    `GeneratePresignedUrlRequest(String bucketName, String key, HttpMethod method)` Constructor.

  - ### 方法概要

    方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `addAdditionalHeaderName(String name)`
    `void` | `addHeader(String key, String value)`
    `void` | `addQueryParameter(String key, String value)`
    `void` | `addUserMetadata(String key, String value)` Add a user's customized metadata.
    `Set<String>` | `getAdditionalHeaderNames()` Gets additional HTTP header names.
    `String` | `getBucketName()` Gets `Bucket` name
    `String` | `getContentMD5()` Gets the file's MD5 value.
    `String` | `getContentType()` Gets the content type header.
    `Date` | `getExpiration()` Gets the expiration time of the Url
    `Map<String,String>` | `getHeaders()` Gets HTTP Headers
    `String` | `getKey()` Gets the `OSSObject` key.
    `HttpMethod` | `getMethod()` Gets Http method.
    `String` | `getProcess()` Gets the process header.
    `Map<String,String>` | `getQueryParameter()` Gets the query parameters.
    `ResponseHeaderOverrides` | `getResponseHeaders()` Gets the response headers to override.
    `int` | `getTrafficLimit()` Gets traffic limit speed , its unit is bit/s
    `Map<String,String>` | `getUserMetadata()` Gets user's customized metadata.
    `void` | `setAdditionalHeaderNames(Set<String> additionalHeaderNames)` Sets additional HTTP header names
    `void` | `setBucketName(String bucketName)` Sets the `Bucket` name.
    `void` | `setContentMD5(String contentMD5)` Sets the file's MD5 value.
    `void` | `setContentType(String contentType)` Sets the content-type header which indicates the file's type.
    `void` | `setExpiration(Date expiration)` Sets the expiration time of the Url
    `void` | `setHeaders(Map<String,String> headers)` Sets Http headers.
    `void` | `setKey(String key)` Sets `OSSObject` key.
    `void` | `setMethod(HttpMethod method)` Sets Http method.
    `void` | `setProcess(String process)` Sets the process header.
    `void` | `setQueryParameter(Map<String,String> queryParam)` Sets the query parameters.
    `void` | `setResponseHeaders(ResponseHeaderOverrides responseHeaders)` Sets the response headers to override.
    `void` | `setTrafficLimit(int trafficLimit)` Sets traffic limit speed , its unit is bit/s
    `void` | `setUserMetadata(Map<String,String> userMetadata)` Gets user's customized metadata.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### GeneratePresignedUrlRequest

          public GeneratePresignedUrlRequest(String bucketName,
                                     String key)

      Constructor with GET as the httpMethod
      参数:
        `bucketName` - Bucket name.
        `key` - Object key.

    - #### GeneratePresignedUrlRequest

          public GeneratePresignedUrlRequest(String bucketName,
                                     String key,
                                     HttpMethod method)

      Constructor.
      参数:
        `bucketName` - Bucket name.
        `key` - Object key.
        `method` - `HttpMethod.GET`。

  - ### 方法详细资料

    - #### getMethod

          public HttpMethod getMethod()

      Gets Http method.
      返回:
        HTTP method.

    - #### setMethod

          public void setMethod(HttpMethod method)

      Sets Http method.
      参数:
        `method` - HTTP method.

    - #### getBucketName

          public String getBucketName()

      Gets `Bucket` name
      返回:
        Bucket name

    - #### setBucketName

          public void setBucketName(String bucketName)

      Sets the `Bucket` name.
      参数:
        `bucketName` - `Bucket` name.

    - #### getKey

          public String getKey()

      Gets the `OSSObject` key.
      返回:
        Object key.

    - #### setKey

          public void setKey(String key)

      Sets `OSSObject` key.
      参数:
        `key` - `OSSObject` key.

    - #### getExpiration

          public Date getExpiration()

      Gets the expiration time of the Url
      返回:
        The expiration time of the Url.

    - #### setExpiration

          public void setExpiration(Date expiration)

      Sets the expiration time of the Url
      参数:
        `expiration` - The expiration time of the Url.

    - #### setContentType

          public void setContentType(String contentType)

      Sets the content-type header which indicates the file's type.
      参数:
        `contentType` - The file's content type.

    - #### getContentType

          public String getContentType()

      Gets the content type header.
      返回:
        Content-Type Header

    - #### setContentMD5

          public void setContentMD5(String contentMD5)

      Sets the file's MD5 value.
      参数:
        `contentMD5` - The target file's MD5 value.

    - #### getContentMD5

          public String getContentMD5()

      Gets the file's MD5 value.
      返回:
        Content-MD5

    - #### setResponseHeaders

          public void setResponseHeaders(ResponseHeaderOverrides responseHeaders)

      Sets the response headers to override.
      参数:
        `responseHeaders` - The response headers to override.

    - #### getResponseHeaders

          public ResponseHeaderOverrides getResponseHeaders()

      Gets the response headers to override.
      返回:
        The response headers to override.

    - #### getUserMetadata

          public Map<String,String> getUserMetadata()

      Gets user's customized metadata.

      OSS uses x-oss-meta- as the prefix in the http headers to transfer the user's customized metadata. However the key value returned by getUserMetadata does not have the prefix---the prefix is added by SDK automatically. The key is case insensitive and will always be in low case when it's returned from OSS. For example, if the key is MyUserMeta，the key returned by this method will be myusermeta.

      返回:
        A `Map` instance that contains the user's customized metadata.

    - #### setUserMetadata

          public void setUserMetadata(Map<String,String> userMetadata)

      Gets user's customized metadata. They will be represented in x-oss-meta* headers.
      参数:
        `userMetadata` - User's metadata

    - #### addUserMetadata

          public void addUserMetadata(String key,
                             String value)

      Add a user's customized metadata.
      参数:
        `key` - The metadata key. Note: this key should not have prefix of 'x-oss-meta-'.
        `value` - the metadata's value.

    - #### getQueryParameter

          public Map<String,String> getQueryParameter()

      Gets the query parameters.
      返回:
        Query parameters.

    - #### setQueryParameter

          public void setQueryParameter(Map<String,String> queryParam)

      Sets the query parameters.
      参数:
        `queryParam` - Query parameters.

    - #### addQueryParameter

          public void addQueryParameter(String key,
                               String value)

      参数:
        `key` -
        `value` -

    - #### getProcess

          public String getProcess()

      Gets the process header.
      返回:
        The process header.

    - #### setProcess

          public void setProcess(String process)

      Sets the process header.
      参数:
        `process` - The process header.

    - #### getHeaders

          public Map<String,String> getHeaders()

      Gets HTTP Headers
      返回:
        HTTP Headers

    - #### setHeaders

          public void setHeaders(Map<String,String> headers)

      Sets Http headers.
      参数:
        `headers` - HTTP Headers。

    - #### addHeader

          public void addHeader(String key,
                       String value)

      参数:
        `key` -
        `value` -

    - #### getAdditionalHeaderNames

          public Set<String> getAdditionalHeaderNames()

      Gets additional HTTP header names.
      返回:
        Additional HTTP header names.

    - #### setAdditionalHeaderNames

          public void setAdditionalHeaderNames(Set<String> additionalHeaderNames)

      Sets additional HTTP header names
      参数:
        `additionalHeaderNames` - additional http header names.

    - #### addAdditionalHeaderName

          public void addAdditionalHeaderName(String name)

    - #### setTrafficLimit

          public void setTrafficLimit(int trafficLimit)

      Sets traffic limit speed , its unit is bit/s

    - #### getTrafficLimit

          public int getTrafficLimit()

      Gets traffic limit speed , its unit is bit/s
      返回:
        traffic limit speed

Copyright © 2020. All Rights Reserved.