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