public class PutObjectRequest extends GenericObjectRequest
Baidu Bos never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored.
trafficLimitBitPS| Modifier | Constructor and Description |
|---|---|
|
PutObjectRequest(String bucketName,
String key,
File file)
Constructs a new PutObjectRequest object to upload a file to the
specified bucket and key.
|
protected |
PutObjectRequest(String bucketName,
String key,
File file,
InputStream inputStream,
ObjectMetadata objectMetadata)
Constructs a new PutObjectRequest object to upload a file and a stream of data to
the specified bucket and key.
|
|
PutObjectRequest(String bucketName,
String key,
File file,
ObjectMetadata metadata)
Constructs a new PutObjectRequest object to upload a file to the
specified bucket and key.
|
|
PutObjectRequest(String bucketName,
String key,
InputStream inputStream)
Constructs a new PutObjectRequest object to upload a stream of data to
the specified bucket and key.
|
|
PutObjectRequest(String bucketName,
String key,
InputStream inputStream,
BosProgressCallback progressCallback)
Constructs a new PutObjectRequest object to upload a stream of data to
the specified bucket and key.
|
|
PutObjectRequest(String bucketName,
String key,
InputStream inputStream,
ObjectMetadata metadata)
Constructs a new PutObjectRequest object to upload a stream of data to
the specified bucket and key.
|
| Modifier and Type | Method and Description |
|---|---|
File |
getFile()
Gets the path and name of the file containing the data to be uploaded to Baidu Bos.
|
InputStream |
getInputStream()
Gets the input stream containing the data to be uploaded to Baidu Bos.
|
ObjectMetadata |
getObjectMetadata()
Gets the optional metadata instructing Baidu Bos how to handle the
uploaded data (e.g.
|
BosProgressCallback |
getProgressCallback()
Gets the BosProgressCallback which used for Get upload progress.
|
String |
getStorageClass()
Gets the storageClass of the input file which is be uploaded to Baidu Bos.
|
long |
getTrafficLimitBitPS()
Gets the limit of put object speed.
|
String |
getVideoProcess()
Gets the parameter of Audio and video processing
|
void |
setFile(File file)
Sets the path and name of the file
containing the data to be uploaded to Baidu Bos.
|
void |
setInputStream(InputStream inputStream)
Sets the input stream containing the data to be uploaded to Baidu Bos.
|
void |
setObjectMetadata(ObjectMetadata objectMetadata)
Sets the optional metadata instructing Baidu Bos how to handle the
uploaded data (e.g.
|
void |
setProgressCallback(BosProgressCallback progressCallback)
Sets the BosProgressCallback which used for Get upload progress.
|
void |
setStorageClass(String storageClass)
Sets the storageClass of the input file which is be uploaded to Baidu Bos.
|
void |
setTrafficLimitBitPS(long trafficLimitBitPS)
Sets Gets the limit of put object speed.
|
void |
setVideoProcess(String videoProcess) |
PutObjectRequest |
withBucketName(String bucketName)
Sets the name of the bucket where this request will upload a new
object to.
|
PutObjectRequest |
withFile(File file)
Sets the file containing the data to be uploaded to Baidu Bos.
|
PutObjectRequest |
withInputStream(InputStream inputStream)
Sets the input stream containing the data to be uploaded to Baidu Bos.
|
PutObjectRequest |
withKey(String key)
Sets the key under which to store the new object.
|
PutObjectRequest |
withObjectMetadata(ObjectMetadata objectMetadata)
Sets the optional metadata instructing Baidu Bos how to handle the
uploaded data (e.g.
|
PutObjectRequest |
withProgressCallback(BosProgressCallback progressCallback) |
PutObjectRequest |
withRequestCredentials(BceCredentials credentials) |
PutObjectRequest |
withStorageClass(String storageClass)
Sets the storageClass of the input file which is be uploaded to Baidu Bos.
|
PutObjectRequest |
withTrafficLimitBitPS(long trafficLimitBitPS) |
PutObjectRequest |
withVideoProcess(String videoProcess) |
getKey, setKeygetBucketName, setBucketNamegetRequestCredentials, setRequestCredentialspublic PutObjectRequest(String bucketName, String key, File file)
bucketName - The name of an existing bucket to which the new object will be uploaded.key - The key under which to store the new object.file - The path of the file to upload to Baidu Bos.public PutObjectRequest(String bucketName, String key, File file, ObjectMetadata metadata)
bucketName - The name of an existing bucket to which the new object will be uploaded.key - The key under which to store the new object.file - The path of the file to upload to Baidu Bos.metadata - The object metadata. At minimum this specifies the
content length for the stream of data being uploaded.public PutObjectRequest(String bucketName, String key, InputStream inputStream)
bucketName - The name of an existing bucket to which the new object will be uploaded.key - The key under which to store the new object.inputStream - The stream of data to upload to Baidu Bos.public PutObjectRequest(String bucketName, String key, InputStream inputStream, BosProgressCallback progressCallback)
bucketName - The name of an existing bucket to which the new object will be uploaded.key - The key under which to store the new object.inputStream - The stream of data to upload to Baidu Bos.progressCallback - The BosProgressCallback, which used for get progress information.public PutObjectRequest(String bucketName, String key, InputStream inputStream, ObjectMetadata metadata)
bucketName - The name of an existing bucket to which the new object will be uploaded.key - The key under which to store the new object.inputStream - The stream of data to upload to Baidu Bos.metadata - The object metadata. At minimum this specifies the
content length for the stream of data being uploaded.protected PutObjectRequest(String bucketName, String key, File file, InputStream inputStream, ObjectMetadata objectMetadata)
bucketName - The name of an existing bucket to which the new object will be uploaded.key - The key under which to store the new object.file - The path of the file to upload to Baidu Bos.inputStream - The stream of data to upload to Baidu Bos.objectMetadata - The object metadata. At minimum this specifies the
content length for the stream of data being uploaded.public PutObjectRequest withRequestCredentials(BceCredentials credentials)
withRequestCredentials in class AbstractBceRequestpublic PutObjectRequest withBucketName(String bucketName)
withBucketName in class GenericBucketRequestbucketName - The name of an existing bucket where this request will upload a new object to.public PutObjectRequest withKey(String key)
withKey in class GenericObjectRequestkey - The key under which to store the new object.public File getFile()
public void setFile(File file)
file - The path and name of the file containing the data to be uploaded to Baidu Bos.public PutObjectRequest withFile(File file)
Either specify a file or an input stream containing the data to be uploaded to Baidu Bos; both cannot be specified.
file - The file containing the data to be uploaded to Baidu Bos.public ObjectMetadata getObjectMetadata()
If uploading from an input stream, always specify metadata with the content size set. Otherwise the contents of the input stream have to be buffered in memory before being sent to Baidu Bos. This can cause very negative performance impacts.
public void setObjectMetadata(ObjectMetadata objectMetadata)
If uploading from an input stream, always specify metadata with the content size set. Otherwise the contents of the input stream have to be buffered in memory before being sent to Baidu Bos. This can cause very negative performance impacts.
objectMetadata - The optional metadata instructing Baidu Bos how to handle the
uploaded data (e.g. custom user metadata, hooks for specifying content type, etc.).public PutObjectRequest withObjectMetadata(ObjectMetadata objectMetadata)
If uploading from an input stream, always specify metadata with the content size set. Otherwise the contents of the input stream have to be buffered in memory before being sent to Baidu Bos. This can cause very negative performance impacts.
objectMetadata - The optional metadata instructing Baidu Bos how to handle the
uploaded data (e.g. custom user metadata, hooks for specifying content type, etc.).public InputStream getInputStream()
public void setInputStream(InputStream inputStream)
inputStream - The input stream containing the data to be uploaded to Baidu Bos.
Either specify a file or an input stream containing the data to be uploaded to Baidu Bos, not both.public PutObjectRequest withInputStream(InputStream inputStream)
Either specify a file or an input stream containing the data to be uploaded to Baidu Bos; both cannot be specified.
inputStream - The InputStream containing the data to be uploaded to Baidu Bos.public String getStorageClass()
public void setStorageClass(String storageClass)
storageClass - The StorageClass is an identification that distinguish between infrequent access bos
and standard bos.public PutObjectRequest withStorageClass(String storageClass)
storageClass - The StorageClass is an identification that distinguish between infrequent access bos
and standard bos.public BosProgressCallback getProgressCallback()
public void setProgressCallback(BosProgressCallback progressCallback)
progressCallback - The BosProgressCallback, which used for get progress information.public PutObjectRequest withProgressCallback(BosProgressCallback progressCallback)
progressCallback - The BosProgressCallback, which used for get progress information.public long getTrafficLimitBitPS()
public void setTrafficLimitBitPS(long trafficLimitBitPS)
trafficLimitBitPS - the limit of put object speed. unit: bit/spublic PutObjectRequest withTrafficLimitBitPS(long trafficLimitBitPS)
trafficLimitBitPS - the limit of put object speed. unit: bit/s, range: 819200 bit/s ~ 838860800 bit/spublic String getVideoProcess()
public void setVideoProcess(String videoProcess)
videoProcess - The parameter of Audio and video processingpublic PutObjectRequest withVideoProcess(String videoProcess)
videoProcess - The parameter of Audio and video processingCopyright © 2023. All rights reserved.