public class GetObjectRequest extends GenericRequest
NOOP
构造器和说明 |
---|
GetObjectRequest(String bucketName,
String key)
Constructs a new
GetObjectRequest with all the required parameters. |
GetObjectRequest(String bucketName,
String key,
String versionId)
Constructs a new
GetObjectRequest with all the required parameters. |
GetObjectRequest(URL absoluteUrl,
Map<String,String> requestHeaders)
Constructor with presigned Url and user's custom headers.
|
限定符和类型 | 方法和说明 |
---|---|
void |
clearMatchingETagConstraints() |
void |
clearNonmatchingETagConstraints() |
URL |
getAbsoluteUri() |
List<String> |
getMatchingETagConstraints()
Gets the matching Etag constraints.
|
Date |
getModifiedSinceConstraint()
Gets the modified since constraints.
|
List<String> |
getNonmatchingETagConstraints()
Gets the non-matching Etag constraints.
|
String |
getProcess() |
long[] |
getRange()
Gets the range of the object to download.
|
ResponseHeaderOverrides |
getResponseHeaders()
Gets the response headers to override.
|
int |
getTrafficLimit()
Gets traffic limit speed, its unit is bit/s
|
Date |
getUnmodifiedSinceConstraint()
Gets the unmodified since constraints.
|
boolean |
isUseUrlSignature() |
void |
setAbsoluteUri(URL absoluteUri) |
void |
setMatchingETagConstraints(List<String> eTagList)
Sets the matching Etag constraints.
|
void |
setModifiedSinceConstraint(Date date)
Sets the modified since constraints.
|
void |
setNonmatchingETagConstraints(List<String> eTagList)
Sets the non-matching Etag constraints.
|
void |
setProcess(String process) |
void |
setRange(long start,
long end)
Sets the range of the object to download (optional).
|
void |
setResponseHeaders(ResponseHeaderOverrides responseHeaders)
Sets the response headers to override (optional).
|
void |
setTrafficLimit(int trafficLimit)
Sets traffic limit speed, its unit is bit/s
|
void |
setUnmodifiedSinceConstraint(Date date)
Sets the unmodified since constraints.
|
void |
setUseUrlSignature(boolean useUrlSignature) |
GetObjectRequest |
withRange(long start,
long end)
Sets the range of the object to download and return current
GetObjectRequest instance (this).
|
getBucketName, getKey, getRequestPayer, getVersionId, setBucketName, setKey, setRequestPayer, setVersionId, withBucketName, withKey, withRequestPayer, withVersionId
public GetObjectRequest(String bucketName, String key)
GetObjectRequest
with all the required parameters.bucketName
- The name of the bucket containing the desired object.key
- The key in the specified bucket under which the object is
stored.public GetObjectRequest(String bucketName, String key, String versionId)
GetObjectRequest
with all the required parameters.bucketName
- The name of the bucket containing the desired object.key
- The key in the specified bucket under which the object is
stored.versionId
- The OSS version ID specifying a specific version of the
object to download.public long[] getRange()
public void setRange(long start, long end)
start
- Start position
When the start is non-negative, it means the starting position to download. When the start is -1, it means the range is determined by the end only and the end could not be -1. For example, when start is -1 and end is 100. It means the download range will be the last 100 bytes.
end
- End position
When the end is non-negative, it means the ending position to download. When the end is -1, it means the range is determined by the start only and the start could not be -1. For example, when end is -1 and start is 100. It means the download range will be all exception first 100 bytes.
public GetObjectRequest withRange(long start, long end)
start
- Start position
When the start is non-negative, it means the starting position to download. When the start is -1, it means the range is determined by the end only and the end could not be -1. For example, when start is -1 and end is 100. It means the download range will be the last 100 bytes.
end
- End position
When the end is non-negative, it means the ending position to download. When the end is -1, it means the range is determined by the start only and the start could not be -1. For example, when end is -1 and start is 100. It means the download range will be all exception first 100 bytes.
public List<String> getMatchingETagConstraints()
public void setMatchingETagConstraints(List<String> eTagList)
eTagList
- The expected ETag list. OSS only supports one ETag.public void clearMatchingETagConstraints()
public List<String> getNonmatchingETagConstraints()
public void setNonmatchingETagConstraints(List<String> eTagList)
eTagList
- The list of expected ETags (only the first one matters
though).public void clearNonmatchingETagConstraints()
public Date getUnmodifiedSinceConstraint()
public void setUnmodifiedSinceConstraint(Date date)
date
- The timestamp.public Date getModifiedSinceConstraint()
public void setModifiedSinceConstraint(Date date)
date
- “If-Modified-Since” parameter.public ResponseHeaderOverrides getResponseHeaders()
public void setResponseHeaders(ResponseHeaderOverrides responseHeaders)
responseHeaders
- The response headers to override.public URL getAbsoluteUri()
public void setAbsoluteUri(URL absoluteUri)
public boolean isUseUrlSignature()
public void setUseUrlSignature(boolean useUrlSignature)
public String getProcess()
public void setProcess(String process)
public void setTrafficLimit(int trafficLimit)
public int getTrafficLimit()
Copyright © 2019. All Rights Reserved.