类 AppendObjectRequest
- java.lang.Object
-
- com.baidubce.model.AbstractBceRequest
-
- com.baidubce.services.bos.model.GenericBucketRequest
-
- com.baidubce.services.bos.model.GenericObjectRequest
-
- com.baidubce.services.bos.model.PutObjectRequest
-
- com.baidubce.services.bos.model.AppendObjectRequest
-
public class AppendObjectRequest extends PutObjectRequest
Uploads a new object to the specified Baidu Bos bucket. The AppendObjectRequest optionally uploads object metadata and applies a canned access control policy to the new object.Baidu Bos never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored.
-
-
字段概要
-
从类继承的字段 com.baidubce.services.bos.model.GenericObjectRequest
trafficLimitBitPS
-
-
构造器概要
构造器 构造器 说明 AppendObjectRequest(String bucketName, String key, File file)Constructs a new AppendObjectRequest object to upload a file to the specified bucket and key.AppendObjectRequest(String bucketName, String key, File file, ObjectMetadata metadata)Constructs a new AppendObjectRequest object to upload an appendable file to the specified bucket and key.AppendObjectRequest(String bucketName, String key, InputStream inputStream)Constructs a new AppendObjectRequest object to upload a stream of data to the specified bucket and key.AppendObjectRequest(String bucketName, String key, InputStream inputStream, ObjectMetadata metadata)Constructs a new AppendObjectRequest object to upload a stream of data to the specified bucket and key.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 LonggetOffset()Gets the offset of the file, which shows the resume position of appendable file.BosProgressCallbackgetProgressCallback()Gets the BosProgressCallback which used for Get upload progress.voidsetOffset(Long offset)Sets the offset of the file, which shows the resume position of appendable file.voidsetProgressCallback(BosProgressCallback progressCallback)Sets the BosProgressCallback which used for Get upload progress.AppendObjectRequestwithBucketName(String bucketName)Sets the name of the bucket where this request will upload a new object to.AppendObjectRequestwithFile(File file)Sets the file containing the data to be uploaded to Baidu Bos.AppendObjectRequestwithInputStream(InputStream inputStream)Sets the input stream containing the data to be uploaded to Baidu Bos.AppendObjectRequestwithKey(String key)Sets the key under which to store the new object.AppendObjectRequestwithObjectMetadata(ObjectMetadata objectMetadata)Sets the optional metadata instructing Baidu Bos how to handle the uploaded data (e.g.AppendObjectRequestwithOffset(Long offset)Sets the offset of the file, which shows the resume position of appendable file.AppendObjectRequestwithProgressCallback(BosProgressCallback progressCallback)AppendObjectRequestwithRequestCredentials(BceCredentials credentials)Sets the optional credentials to use for this request, overriding the default credentials set at the client level.-
从类继承的方法 com.baidubce.services.bos.model.PutObjectRequest
getFile, getInputStream, getObjectMetadata, getStorageClass, getTrafficLimitBitPS, getVideoProcess, setFile, setInputStream, setObjectMetadata, setStorageClass, setTrafficLimitBitPS, setVideoProcess, withStorageClass, withTrafficLimitBitPS, withVideoProcess
-
从类继承的方法 com.baidubce.services.bos.model.GenericObjectRequest
getKey, setKey
-
从类继承的方法 com.baidubce.services.bos.model.GenericBucketRequest
getBucketName, setBucketName
-
从类继承的方法 com.baidubce.model.AbstractBceRequest
getRequestCredentials, setRequestCredentials
-
-
-
-
构造器详细资料
-
AppendObjectRequest
public AppendObjectRequest(String bucketName, String key, File file)
Constructs a new AppendObjectRequest object to upload a file to the specified bucket and key. After constructing the request, users may optionally specify object metadata or a canned ACL as well.- 参数:
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.
-
AppendObjectRequest
public AppendObjectRequest(String bucketName, String key, File file, ObjectMetadata metadata)
Constructs a new AppendObjectRequest object to upload an appendable file to the specified bucket and key. After constructing the request, users may optionally specify object metadata or a canned ACL as well.- 参数:
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.
-
AppendObjectRequest
public AppendObjectRequest(String bucketName, String key, InputStream inputStream)
Constructs a new AppendObjectRequest object to upload a stream of data to the specified bucket and key. After constructing the request, users may optionally specify object metadata or a canned ACL as well.- 参数:
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.
-
AppendObjectRequest
public AppendObjectRequest(String bucketName, String key, InputStream inputStream, ObjectMetadata metadata)
Constructs a new AppendObjectRequest object to upload a stream of data to the specified bucket and key. After constructing the request, users may optionally specify object metadata or a canned ACL as well.- 参数:
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.
-
-
方法详细资料
-
getOffset
public Long getOffset()
Gets the offset of the file, which shows the resume position of appendable file.- 返回:
- The offset that indicates the size of data has been uploaded to Baidu bos.
-
setOffset
public void setOffset(Long offset)
Sets the offset of the file, which shows the resume position of appendable file.- 参数:
offset- The offset indicates the size of data has been uploaded to Baidu bos.
-
withOffset
public AppendObjectRequest withOffset(Long offset)
Sets the offset of the file, which shows the resume position of appendable file.- 参数:
offset- The offset indicates the size of data has been uploaded to Baidu bos.- 返回:
- This AppendObjectRequest, so that additional method calls to be chained together.
-
withObjectMetadata
public AppendObjectRequest withObjectMetadata(ObjectMetadata objectMetadata)
Sets the optional metadata instructing Baidu Bos how to handle the uploaded data (e.g. custom user metadata, hooks for specifying content type, etc.). Returns this AppendObjectRequest, enabling additional method calls to be chained together.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.
- 覆盖:
withObjectMetadata在类中PutObjectRequest- 参数:
objectMetadata- The optional metadata instructing Baidu Bos how to handle the uploaded data (e.g. custom user metadata, hooks for specifying content type, etc.).- 返回:
- This AppendObjectRequest, so that additional method calls to be chained together.
-
withFile
public AppendObjectRequest withFile(File file)
Sets the file containing the data to be uploaded to Baidu Bos. Returns this AppendObjectRequest, enabling additional method calls to be chained together.Either specify a file or an input stream containing the data to be uploaded to Baidu Bos; both cannot be specified.
- 覆盖:
withFile在类中PutObjectRequest- 参数:
file- The file containing the data to be uploaded to Baidu Bos.- 返回:
- This AppendObjectRequest, enabling additional method calls to be chained together.
-
withInputStream
public AppendObjectRequest withInputStream(InputStream inputStream)
Sets the input stream containing the data to be uploaded to Baidu Bos. Returns this AppendObjectRequest, enabling additional method calls to be chained together.Either specify a file or an input stream containing the data to be uploaded to Baidu Bos; both cannot be specified.
- 覆盖:
withInputStream在类中PutObjectRequest- 参数:
inputStream- The InputStream containing the data to be uploaded to Baidu Bos.- 返回:
- This AppendObjectRequest, so that additional method calls can be chained together.
-
withRequestCredentials
public AppendObjectRequest withRequestCredentials(BceCredentials credentials)
Sets the optional credentials to use for this request, overriding the default credentials set at the client level.- 覆盖:
withRequestCredentials在类中PutObjectRequest- 参数:
credentials- The optional BOS security credentials to use for this request.- 返回:
- This AppendObjectRequest, so that additional method calls can be chained together.
-
withBucketName
public AppendObjectRequest withBucketName(String bucketName)
Sets the name of the bucket where this request will upload a new object to. Returns this object, enabling additional method calls to be chained together.- 覆盖:
withBucketName在类中PutObjectRequest- 参数:
bucketName- The name of an existing bucket where this request will upload a new object to.- 返回:
- This AppendObjectRequest, enabling additional method calls to be chained together.
-
withKey
public AppendObjectRequest withKey(String key)
Sets the key under which to store the new object. Returns this object, enabling additional method calls to be chained together.- 覆盖:
withKey在类中PutObjectRequest- 参数:
key- The key under which to store the new object.- 返回:
- This AppendObjectRequest, so that additional method calls to be chained together.
-
getProgressCallback
public BosProgressCallback getProgressCallback()
Gets the BosProgressCallback which used for Get upload progress.- 覆盖:
getProgressCallback在类中PutObjectRequest- 返回:
- The BosProgressCallback which used for get progress information.
-
setProgressCallback
public void setProgressCallback(BosProgressCallback progressCallback)
Sets the BosProgressCallback which used for Get upload progress.- 覆盖:
setProgressCallback在类中PutObjectRequest- 参数:
progressCallback- The BosProgressCallback, which used for get progress information.
-
withProgressCallback
public AppendObjectRequest withProgressCallback(BosProgressCallback progressCallback)
- 覆盖:
withProgressCallback在类中PutObjectRequest- 参数:
progressCallback- The BosProgressCallback, which used for get progress information.- 返回:
- This AppendObjectRequest, so that additional method calls can be chained together
-
-