public class PutObjectRequest extends PutObjectBasicRequest
Modifier and Type | Field and Description |
---|---|
protected int |
expires |
protected File |
file |
protected InputStream |
input |
protected ObjectMetadata |
metadata |
protected long |
offset |
acl, extensionPermissionMap, sseCHeader, sseKmsHeader, successRedirectLocation
encodeHeaders, objectKey
bucketName, httpMethod, userHeaders
Constructor and Description |
---|
PutObjectRequest() |
PutObjectRequest(PutObjectBasicRequest request) |
PutObjectRequest(String bucketName) |
PutObjectRequest(String bucketName,
String objectKey)
Constructor
|
PutObjectRequest(String bucketName,
String objectKey,
File file)
Constructor
|
PutObjectRequest(String bucketName,
String objectKey,
InputStream input)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getExpires()
Obtain the expiration time of the object.
|
File |
getFile()
Obtain the file to be uploaded, which cannot be used with the data
stream.
|
InputStream |
getInput()
Obtain the data stream to be uploaded, which cannot be used with the file
to be uploaded.
|
ObjectMetadata |
getMetadata()
Obtain object properties, including "content-type", "content-length",
"content-md5", and customized metadata.
|
long |
getOffset()
Obtain the start position of the to-be-uploaded content in the file.
|
long |
getProgressInterval()
Obtain the callback threshold of the data transfer listener.
|
ProgressListener |
getProgressListener()
Obtain the data transfer listener.
|
boolean |
isAutoClose()
Check whether the input stream will be automatically closed.
|
void |
setAutoClose(boolean autoClose)
Specify whether to automatically close the input stream.
|
void |
setExpires(int expires)
Set the expiration time of the object.
|
void |
setFile(File file)
Set the file to be uploaded, which cannot be used with the data stream.
|
void |
setInput(InputStream input)
Set the data stream to be uploaded, which cannot be used with the file to
be uploaded.
|
void |
setMetadata(ObjectMetadata metadata)
Set the object properties, including "content-type", "content-length",
and customized metadata.
|
void |
setOffset(long offset)
Set the start position of the to-be-uploaded content in the file.
|
void |
setProgressInterval(long progressInterval)
Set the callback threshold of the data transfer listener.
|
void |
setProgressListener(ProgressListener progressListener)
Set the data transfer listener.
|
String |
toString() |
getAcl, getAllGrantPermissions, getDomainIdsByGrantPermission, getExtensionPermissionMap, getGrantPermissionsByDomainId, getSseCHeader, getSseKmsHeader, getSuccessRedirectLocation, grantExtensionPermission, setAcl, setExtensionPermissionMap, setSseCHeader, setSseKmsHeader, setSuccessRedirectLocation, withdrawExtensionPermission, withdrawExtensionPermissions
getObjectKey, isEncodeHeaders, setIsEncodeHeaders, setObjectKey
addUserHeaders, getBucketName, getHttpMethod, getUserHeaders, isRequesterPays, setBucketName, setRequesterPays, setUserHeaders
protected File file
protected InputStream input
protected ObjectMetadata metadata
protected int expires
protected long offset
public PutObjectRequest()
public PutObjectRequest(String bucketName)
public PutObjectRequest(PutObjectBasicRequest request)
public PutObjectRequest(String bucketName, String objectKey)
bucketName
- Bucket nameobjectKey
- Object namepublic PutObjectRequest(String bucketName, String objectKey, File file)
bucketName
- Bucket nameobjectKey
- Object namefile
- File to be uploadedpublic PutObjectRequest(String bucketName, String objectKey, InputStream input)
bucketName
- Bucket nameobjectKey
- Object nameinput
- Data stream to be uploadedpublic long getOffset()
public void setOffset(long offset)
offset
- Start position of the content to be uploaded in the local filepublic InputStream getInput()
public void setInput(InputStream input)
input
- Data stream to be uploadedpublic ObjectMetadata getMetadata()
public void setMetadata(ObjectMetadata metadata)
metadata
- Object propertiespublic File getFile()
public void setFile(File file)
file
- File to be uploadedpublic int getExpires()
public void setExpires(int expires)
expires
- Expiration time of the objectpublic boolean isAutoClose()
public void setAutoClose(boolean autoClose)
autoClose
- Identifier specifying whether the input stream will be
automatically closedpublic ProgressListener getProgressListener()
public void setProgressListener(ProgressListener progressListener)
progressListener
- Data transfer listenerpublic long getProgressInterval()
public void setProgressInterval(long progressInterval)
progressInterval
- Callback threshold of the data transfer listenerpublic String toString()
toString
in class BaseObjectRequest
Copyright © 2021. All rights reserved.