类 CreateMediaResourceRequest


  • public class CreateMediaResourceRequest
    extends AbstractBceRequest
    Uploads a new object to the specified Baidu VOD bucket. The PutObjectRequest optionally uploads object metadata and applies a canned access control policy to the new object.

    Baidu VOD never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored.

    • 构造器详细资料

      • CreateMediaResourceRequest

        public CreateMediaResourceRequest()
    • 方法详细资料

      • 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 CreateMediaResourceRequest 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 CreateMediaResourceRequest 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 CreateMediaResourceRequest 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.