类 PutObjectRequest

  • 直接已知子类:
    AppendObjectRequest

    public class PutObjectRequest
    extends GenericObjectRequest
    Uploads a new object to the specified Baidu Bos bucket. The PutObjectRequest 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.

    • 构造器详细资料

      • PutObjectRequest

        public PutObjectRequest​(String bucketName,
                                String key,
                                File file)
        Constructs a new PutObjectRequest 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.
      • PutObjectRequest

        public PutObjectRequest​(String bucketName,
                                String key,
                                File file,
                                ObjectMetadata metadata)
        Constructs a new PutObjectRequest 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.
        metadata - The object metadata. At minimum this specifies the content length for the stream of data being uploaded.
      • PutObjectRequest

        public PutObjectRequest​(String bucketName,
                                String key,
                                InputStream inputStream)
        Constructs a new PutObjectRequest 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.
      • PutObjectRequest

        public 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. 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.
        progressCallback - The BosProgressCallback, which used for get progress information.
      • PutObjectRequest

        public 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. 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.
      • PutObjectRequest

        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. 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.
        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.
    • 方法详细资料

      • withBucketName

        public PutObjectRequest 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 在类中 GenericBucketRequest
        参数:
        bucketName - The name of an existing bucket where this request will upload a new object to.
        返回:
        This PutObjectRequest, enabling additional method calls to be chained together.
      • withKey

        public PutObjectRequest 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 在类中 GenericObjectRequest
        参数:
        key - The key under which to store the new object.
        返回:
        This PutObjectRequest, enabling additional method calls to be chained together.
      • getFile

        public File getFile()
        Gets the path and name of the file 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; both cannot be specified.
        返回:
        The path and name of the file containing the data to be uploaded to Baidu Bos.
      • setFile

        public void setFile​(File file)
        Sets the path and name of the file 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; both cannot be specified.
        参数:
        file - The path and name of the file containing the data to be uploaded to Baidu Bos.
      • withFile

        public PutObjectRequest withFile​(File file)
        Sets the file containing the data to be uploaded to Baidu Bos. Returns this PutObjectRequest, 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.

        参数:
        file - The file containing the data to be uploaded to Baidu Bos.
        返回:
        This PutObjectRequest, enabling additional method calls to be chained together.
      • getObjectMetadata

        public ObjectMetadata getObjectMetadata()
        Gets the optional metadata instructing Baidu Bos how to handle the uploaded data (e.g. custom user metadata, hooks for specifying content type, etc.).

        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.

        返回:
        The optional metadata instructing Baidu Bos how to handle the uploaded data (e.g. custom user metadata, hooks for specifying content type, etc.).
      • setObjectMetadata

        public void setObjectMetadata​(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.).

        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.).
      • withObjectMetadata

        public PutObjectRequest 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 PutObjectRequest, 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.

        参数:
        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 PutObjectRequest, enabling additional method calls to be chained together.
      • getInputStream

        public InputStream getInputStream()
        Gets the input stream containing the data to be uploaded to Baidu Bos. The user of this request must either specify a file or an input stream containing the data to be uploaded to Baidu Bos; both cannot be specified.
        返回:
        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.
      • setInputStream

        public void setInputStream​(InputStream inputStream)
        Sets 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; both cannot be specified.
        参数:
        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.
      • withInputStream

        public PutObjectRequest withInputStream​(InputStream inputStream)
        Sets the input stream containing the data to be uploaded to Baidu Bos. Returns this PutObjectRequest, 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.

        参数:
        inputStream - The InputStream containing the data to be uploaded to Baidu Bos.
        返回:
        This PutObjectRequest, so that additional method calls can be chained together.
      • getStorageClass

        public String getStorageClass()
        Gets the storageClass of the input file which is be uploaded to Baidu Bos.
        返回:
        storageClass The StorageClass is an identification that distinguish between infrequent access bos and standard bos.
      • setStorageClass

        public void setStorageClass​(String storageClass)
        Sets the storageClass of the input file which is be uploaded to Baidu Bos.
        参数:
        storageClass - The StorageClass is an identification that distinguish between infrequent access bos and standard bos.
      • withStorageClass

        public PutObjectRequest withStorageClass​(String storageClass)
        Sets the storageClass of the input file which is be uploaded to Baidu Bos.
        参数:
        storageClass - The StorageClass is an identification that distinguish between infrequent access bos and standard bos.
        返回:
        This PutObjectRequest, so that additional method calls can be chained together.
      • getProgressCallback

        public BosProgressCallback getProgressCallback()
        Gets the BosProgressCallback which used for Get upload progress.
        返回:
        The BosProgressCallback which used for get progress information.
      • setProgressCallback

        public void setProgressCallback​(BosProgressCallback progressCallback)
        Sets the BosProgressCallback which used for Get upload progress.
        参数:
        progressCallback - The BosProgressCallback, which used for get progress information.
      • withProgressCallback

        public PutObjectRequest withProgressCallback​(BosProgressCallback progressCallback)
        参数:
        progressCallback - The BosProgressCallback, which used for get progress information.
        返回:
        This PutObjectRequest, so that additional method calls can be chained together
      • getTrafficLimitBitPS

        public long getTrafficLimitBitPS()
        Gets the limit of put object speed.
        返回:
        the limit of put object speed. unit: bit/s
      • setTrafficLimitBitPS

        public void setTrafficLimitBitPS​(long trafficLimitBitPS)
        Sets Gets the limit of put object speed. range: 819200 bit/s ~ 838860800 bit/s
        参数:
        trafficLimitBitPS - the limit of put object speed. unit: bit/s
      • withTrafficLimitBitPS

        public PutObjectRequest withTrafficLimitBitPS​(long trafficLimitBitPS)
        参数:
        trafficLimitBitPS - the limit of put object speed. unit: bit/s, range: 819200 bit/s ~ 838860800 bit/s
        返回:
        This PutObjectRequest, so that additional method calls can be chained together
      • getVideoProcess

        public String getVideoProcess()
        Gets the parameter of Audio and video processing
        返回:
        the parameter of Audio and video processing
      • setVideoProcess

        public void setVideoProcess​(String videoProcess)
        参数:
        videoProcess - The parameter of Audio and video processing
      • withVideoProcess

        public PutObjectRequest withVideoProcess​(String videoProcess)
        参数:
        videoProcess - The parameter of Audio and video processing
        返回:
        This PutObjectRequest, so that additional method calls can be chained together