类 ObjectMetadata


  • public class ObjectMetadata
    extends Object
    Represents the object metadata that is stored with Baidu Bos. This includes custom user-supplied metadata, as well as the standard HTTP headers that Baidu Bos sends and receives (Content-Length, ETag, Content-MD5, etc.).
    • 构造器详细资料

      • ObjectMetadata

        public ObjectMetadata()
    • 方法详细资料

      • getUserMetadata

        public Map<String,​String> getUserMetadata()
        Gets the custom user-metadata for the associated object.
        返回:
        The custom user metadata for the associated object.
      • setUserMetadata

        public void setUserMetadata​(Map<String,​String> userMetadata)
        Sets the custom user-metadata for the associated object.
        参数:
        userMetadata - The custom user-metadata for the associated object. Note that the key should not include the internal Bos HTTP header prefix.
      • addUserMetadata

        public void addUserMetadata​(String key,
                                    String value)
        Adds the key value pair of custom user-metadata for the associated object. If the entry in the custom user-metadata map already contains the specified key, it will be replaced with these new contents.
        参数:
        key - The key for the custom user metadata entry. Note that the key should not include the internal Bos HTTP header prefix.
        value - The value for the custom user-metadata entry.
      • getUserMetaDataOf

        public String getUserMetaDataOf​(String key)
        For internal use only. Returns the value of the userMetadata for the specified key.
        参数:
        key - the key of the userMetadata
        返回:
        the value of the userMetadata
      • setContentRange

        public void setContentRange​(String contentRange)
        Sets the content range of object.
        参数:
        contentRange - The content range of object.
      • getContentRange

        public String getContentRange()
        Gets the content range of object.
        返回:
        The content range of object.
      • getBceContentSha256

        public String getBceContentSha256()
        Gets the SHA-256 of the object content.
        返回:
        The SHA-256 of the object content.
      • setBceContentSha256

        public void setBceContentSha256​(String bceContentSha256)
        Sets the SHA-256 of the object content.
        参数:
        bceContentSha256 - The SHA-256 of the object content.
      • getContentDisposition

        public String getContentDisposition()
        Gets the optional Content-Disposition HTTP header, which specifies presentation information for the object such as the recommended filename for the object to be saved as.
        返回:
        The value of the Content-Disposition header. Returns null if the Content-Disposition header hasn't been set.
      • setContentDisposition

        public void setContentDisposition​(String contentDisposition)
        Sets the optional Content-Disposition HTTP header, which specifies presentational information such as the recommended filename for the object to be saved as.
        参数:
        contentDisposition - The value for the Content-Disposition header.
      • getContentEncoding

        public String getContentEncoding()
        Gets the optional Content-Encoding HTTP header specifying what content encodings have been applied to the object and what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type field.
        返回:
        The HTTP Content-Encoding header. Returns null if it hasn't been set.
      • setContentEncoding

        public void setContentEncoding​(String contentEncoding)
        Sets the optional Content-Encoding HTTP header specifying what content encodings have been applied to the object and what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type field.
        参数:
        contentEncoding - The HTTP Content-Encoding header, as defined in RFC 2616.
      • getContentLength

        public long getContentLength()
        Gets the Content-Length HTTP header indicating the size of the associated object in bytes.
        返回:
        The Content-Length HTTP header indicating the size of the associated object in bytes. Returns null if it hasn't been set yet.
      • setContentLength

        public void setContentLength​(long contentLength)
        Sets the Content-Length HTTP header indicating the size of the associated object in bytes.
        参数:
        contentLength - The Content-Length HTTP header indicating the size of the associated object in bytes.
      • getContentMd5

        public String getContentMd5()
        Gets the base64 encoded 128-bit MD5 digest of the associated object (content - not including headers) according to RFC 1864. This data is used as a message integrity check to verify that the data received by Baidu Bos is the same data that the caller sent.
        返回:
        The base64 encoded MD5 hash of the content for the associated object. Returns null if the MD5 hash of the content hasn't been set.
      • setContentMd5

        public void setContentMd5​(String contentMd5)
        Sets the base64 encoded 128-bit MD5 digest of the associated object (content - not including headers) according to RFC 1864. This data is used as a message integrity check to verify that the data received by Baidu Bos is the same data that the caller sent. If set to null,then the MD5 digest is removed from the metadata.
        参数:
        contentMd5 - The base64 encoded MD5 hash of the content for the object associated with this metadata.
      • getContentType

        public String getContentType()
        Gets the Content-Type HTTP header, which indicates the type of content stored in the associated object. The value of this header is a standard MIME type.
        返回:
        The HTTP Content-Type header, indicating the type of content stored in the associated Bos object. Returns null if it hasn't been set.
      • setContentType

        public void setContentType​(String contentType)
        Sets the Content-Type HTTP header indicating the type of content stored in the associated object. The value of this header is a standard MIME type.
        参数:
        contentType - The HTTP Content-Type header indicating the type of content stored in the associated Bos object.
      • getETag

        public String getETag()
        Gets the hex encoded 128-bit MD5 digest of the associated object according to RFC 1864. This data is used as an integrity check to verify that the data received by the caller is the same data that was sent by Baidu Bos.

        This field represents the hex encoded 128-bit MD5 digest of an object's content as calculated by Baidu Bos. The ContentMD5 field represents the base64 encoded 128-bit MD5 digest as calculated on the caller's side.

        返回:
        The hex encoded MD5 hash of the content for the associated object as calculated by Baidu Bos. Returns null if it hasn't been set yet.
      • setETag

        public void setETag​(String eTag)
        Sets the hex encoded 128-bit MD5 digest of the associated object according to RFC 1864. This data is used as an integrity check to verify that the data received by the caller is the same data that was sent by Baidu Bos.

        This field represents the hex encoded 128-bit MD5 digest of an object's content as calculated by Baidu Bos. The ContentMD5 field represents the base64 encoded 128-bit MD5 digest as calculated on the caller's side.

        参数:
        eTag - The hex encoded MD5 hash of the content for the associated object as calculated by Baidu Bos.
      • getInstanceLength

        public long getInstanceLength()
        Returns the physical length of the entire object stored in Bos. This is useful during, for example, a range get operation.
        返回:
        the physical length of the entire object
      • setInstanceLength

        public void setInstanceLength​(long instanceLength)
        Sets the physical length of the entire object stored in Bos.
        参数:
        instanceLength - the physical length of the entire object
      • getLastModified

        public Date getLastModified()
        Gets the value of the Last-Modified header, indicating the date and time at which Baidu Bos last recorded a modification to the associated object.
        返回:
        The date and time at which Baidu Bos last recorded a modification to the associated object. Returns null if the Last-Modified header hasn't been set.
      • setLastModified

        public void setLastModified​(Date lastModified)
        For internal use only. Sets the Last-Modified header value indicating the date and time at which Baidu Bos last recorded a modification to the associated object.
        参数:
        lastModified - The date and time at which Baidu Bos last recorded a modification to the associated object.
      • getExpires

        public String getExpires()
      • setExpires

        public void setExpires​(String expires)
      • getAppendOffset

        public long getAppendOffset()
      • setAppendOffset

        public void setAppendOffset​(long appendOffset)
      • getObjectType

        public String getObjectType()
      • setObjectType

        public void setObjectType​(String objectType)
      • getCacheControl

        public String getCacheControl()
      • setCacheControl

        public void setCacheControl​(String cacheControl)
      • getStorageClass

        public String getStorageClass()
      • setStorageClass

        public void setStorageClass​(String storageClass)
      • getxBceCrc

        public String getxBceCrc()
        Gets the crc of object.
        返回:
        the crc of object.
      • setxBceCrc

        public void setxBceCrc​(String xBceCrc)
        Sets the crc of object.
      • getRestore

        public String getRestore()
        Gets archive object restore status
        返回:
      • setRestore

        public void setRestore​(String restore)
        Sets archive object restore status
        参数:
        restore -
      • getxBceAcl

        public String getxBceAcl()
        Get the canned acl of object.
        返回:
        the canned acl of object.
      • setxBceAcl

        public void setxBceAcl​(String xBceAcl)
        Set the canned acl of object.