类 BosObject

  • 所有已实现的接口:
    Closeable, AutoCloseable

    public class BosObject
    extends Object
    implements Closeable
    Represents an object stored in Baidu Bos. This object contains the data content and the object metadata stored by Baidu Bos, such as content type, content length, etc.
    • 构造器详细资料

      • BosObject

        public BosObject()
    • 方法详细资料

      • getBucketName

        public String getBucketName()
        Gets the name of the bucket in which this object is contained.
        返回:
        The name of the bucket in which this object is contained.
      • setBucketName

        public void setBucketName​(String bucketName)
        Sets the name of the bucket in which this object is contained.
        参数:
        bucketName - The name of the bucket containing this object.
      • getKey

        public String getKey()
        Gets the key under which this object is stored.
        返回:
        The key under which this object is stored.
      • setKey

        public void setKey​(String key)
        Sets the key under which this object is stored.
        参数:
        key - The key under which this object is stored.
      • getObjectMetadata

        public ObjectMetadata getObjectMetadata()
        Gets the metadata stored by Bos for this object. The ObjectMetadata object includes any custom user metadata supplied by the caller when the object was uploaded, as well as HTTP metadata such as content length and content type.
        返回:
        The metadata stored by Baidu Bos for this object.
      • setObjectMetadata

        public void setObjectMetadata​(ObjectMetadata objectMetadata)
        Sets the object metadata for this object.
        参数:
        objectMetadata - The new metadata to set for this object in memory.
      • getObjectContent

        public BosObjectInputStream getObjectContent()
        Gets an input stream containing the contents of this object. Callers should close this input stream as soon as possible, because the object contents aren't buffered in memory and stream directly from Baidu Bos.
        返回:
        An input stream containing the contents of this object.
      • setObjectContent

        public void setObjectContent​(BosObjectInputStream objectContent)
        Sets the input stream containing this object's contents.
        参数:
        objectContent - The input stream containing this object's contents.