com.aliyun.oss.model

## 类 ObjectMetadata

- java.lang.Object
- - com.aliyun.oss.model.ObjectMetadata

- 直接已知子类:
    SelectObjectMetadata

      public class ObjectMetadata
      extends Object

  OSS Object's metadata. It has the user's custom metadata, as well as some standard http headers sent to OSS, such as Content-Length, ETag, etc.

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static String` | `AES_256_SERVER_SIDE_ENCRYPTION`
    `static String` | `KMS_SERVER_SIDE_ENCRYPTION`
    `protected Map<String,Object>` | `metadata`

  - ### 构造器概要

    构造器
    构造器和说明
    `ObjectMetadata()`

  - ### 方法概要

    方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `addUserMetadata(String key, String value)` Adds a new custom metadata.
    `String` | `getCacheControl()` Gets the Cache-Control header.
    `String` | `getContentDisposition()` Gets the Content-Disposition header.This is the standard http header.
    `String` | `getContentEncoding()` Gets the Content-Encoding header which is to encode the object content.
    `long` | `getContentLength()` Gets Content-Length header, which is the object content's size.
    `String` | `getContentMD5()`
    `String` | `getContentType()` Gets the Content-Type header to indicate the object content's type in MIME type format.
    `String` | `getETag()` Gets the ETag of the object.
    `Date` | `getExpirationTime()` Gets the `Date` value of the "Expires" header in Rfc822 format.
    `Date` | `getLastModified()` Gets the value of Last-Modified header, which means the last modified time of the object.
    `String` | `getObjectRawRestore()` Gets the restore status of the object of Archive type.
    `StorageClass` | `getObjectStorageClass()` Gets the object's storage class, which is "standard", "IA" or "Archive".
    `String` | `getObjectType()` Gets the object's storage type, which only supports "normal" and "appendable" for now.
    `String` | `getRawExpiresValue()` Gets the string value of the "Expires" header in Rfc822 format.
    `Map<String,Object>` | `getRawMetadata()` Gets the raw metadata (SDK internal usage only).
    `String` | `getRequestId()` Gets the request Id.
    `Long` | `getServerCRC()` Gets the service crc.
    `String` | `getServerSideDataEncryption()` Gets the object's server side data encryption.
    `String` | `getServerSideEncryption()` Gets the object's server side encryption.
    `String` | `getServerSideEncryptionKeyId()` Gets the object's server side encryption key ID.
    `Map<String,String>` | `getUserMetadata()` Gets the user's custom metadata.
    `String` | `getVersionId()` Gets the version ID of the associated OSS object if available.
    `boolean` | `isRestoreCompleted()` Gets the flag of completeness of restoring the Archive file.
    `void` | `removeHeader(String key)` Removes the http header (SDK internal usage only).
    `void` | `setCacheControl(String cacheControl)` Sets the Cache-Control header.
    `void` | `setContentDisposition(String disposition)` Sets Content-Disposition header.
    `void` | `setContentEncoding(String encoding)` Sets the Content-Encoding header which is to encode the object content.
    `void` | `setContentLength(long contentLength)` Sets the Content-Length header to indicate the object's size.
    `void` | `setContentMD5(String contentMD5)`
    `void` | `setContentType(String contentType)` Sets the Content-Type header to indicate the object content's type in MIME type format.
    `void` | `setExpirationTime(Date expirationTime)` Sets the "Expires" header.
    `void` | `setHeader(String key, Object value)` Sets the http header (SDK internal usage only).
    `void` | `setLastModified(Date lastModified)` Sets the value of Last-Modified header, which means the last modified time of the object.
    `void` | `setObjectAcl(CannedAccessControlList cannedAcl)` Sets the object ACL.
    `void` | `setObjectTagging(Map<String,String> tags)`
    `void` | `setServerSideDataEncryption(String serverSideDataEncryption)` Sets the object's server side data encryption.
    `void` | `setServerSideEncryption(String serverSideEncryption)` Sets the object's server side encryption.
    `void` | `setServerSideEncryptionKeyId(String serverSideEncryptionKeyId)` Sets the object's server side encryption key ID.
    `void` | `setUserMetadata(Map<String,String> userMetadata)` Sets the user's custom metadata.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 字段详细资料

    - #### metadata

          protected Map<String,Object> metadata

    - #### AES_256_SERVER_SIDE_ENCRYPTION

          public static final String AES_256_SERVER_SIDE_ENCRYPTION

      另请参阅:
        常量字段值

    - #### KMS_SERVER_SIDE_ENCRYPTION

          public static final String KMS_SERVER_SIDE_ENCRYPTION

      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### ObjectMetadata

          public ObjectMetadata()

  - ### 方法详细资料

    - #### getUserMetadata

          public Map<String,String> getUserMetadata()

      Gets the user's custom metadata.

      The custom metadata would be appended with x-oss-meta- in the request to OSS. But here the caller should not use x-oss-meta- as the prefix for the keys of the Map instance returned. Meanwhile，the keys is case insenstive and all keys returned from OSS server is in lower case.

      返回:
        User's custom metadata.

    - #### setUserMetadata

          public void setUserMetadata(Map<String,String> userMetadata)

      Sets the user's custom metadata.
      参数:
        `userMetadata` - The user's custom metadata.

    - #### setHeader

          public void setHeader(String key,
                       Object value)

      Sets the http header (SDK internal usage only).
      参数:
        `key` - The key of header
        `value` - The value of the key.

    - #### removeHeader

          public void removeHeader(String key)

      Removes the http header (SDK internal usage only).
      参数:
        `key` - The key of header.

    - #### addUserMetadata

          public void addUserMetadata(String key,
                             String value)

      Adds a new custom metadata.
      参数:
        `key` - Key of the header (not starting with x-oss-meta-)
        `value` - The value for the key.

    - #### getLastModified

          public Date getLastModified()

      Gets the value of Last-Modified header, which means the last modified time of the object.
      返回:
        Object's last modified time.

    - #### setLastModified

          public void setLastModified(Date lastModified)

      Sets the value of Last-Modified header, which means the last modified time of the object.
      参数:
        `lastModified` - Object's last modified time.

    - #### getExpirationTime

          public Date getExpirationTime()
                                 throws ParseException

      Gets the `Date` value of the "Expires" header in Rfc822 format. If expiration is not set, then the value is null.
      返回:
        Expires header's value in Rfc822.
      抛出:
        `ParseException` - The value is not in the Rfc822 format.

    - #### getRawExpiresValue

          public String getRawExpiresValue()

      Gets the string value of the "Expires" header in Rfc822 format. If expiration is not set, then the value is null.
      返回:
        The string value of "Expires" header.

    - #### setExpirationTime

          public void setExpirationTime(Date expirationTime)

      Sets the "Expires" header.
      参数:
        `expirationTime` - Expiration time.

    - #### getContentLength

          public long getContentLength()

      Gets Content-Length header, which is the object content's size.
      返回:
        The object content's size.

    - #### setContentLength

          public void setContentLength(long contentLength)

      Sets the Content-Length header to indicate the object's size. The correct Content-Length header is needed for a file upload.
      参数:
        `contentLength` - Object content size.

    - #### getContentType

          public String getContentType()

      Gets the Content-Type header to indicate the object content's type in MIME type format.
      返回:
        The content-type header in MIME type format.

    - #### setContentType

          public void setContentType(String contentType)

      Sets the Content-Type header to indicate the object content's type in MIME type format.
      参数:
        `contentType` - The content-type header in MIME type format.

    - #### getContentMD5

          public String getContentMD5()

    - #### setContentMD5

          public void setContentMD5(String contentMD5)

    - #### getContentEncoding

          public String getContentEncoding()

      Gets the Content-Encoding header which is to encode the object content.
      返回:
        Object content's encoding.

    - #### setContentEncoding

          public void setContentEncoding(String encoding)

      Sets the Content-Encoding header which is to encode the object content.
      参数:
        `encoding` - Object content's encoding.

    - #### getCacheControl

          public String getCacheControl()

      Gets the Cache-Control header. This is the standard http header.
      返回:
        Cache-Control header.

    - #### setCacheControl

          public void setCacheControl(String cacheControl)

      Sets the Cache-Control header. This is the standard http header.
      参数:
        `cacheControl` - Cache-Control header.

    - #### getContentDisposition

          public String getContentDisposition()

      Gets the Content-Disposition header.This is the standard http header.
      返回:
        Content-Disposition header.

    - #### setContentDisposition

          public void setContentDisposition(String disposition)

      Sets Content-Disposition header.
      参数:
        `disposition` - Content-Disposition header.

    - #### getETag

          public String getETag()

      Gets the ETag of the object. ETag is the 128bit MD5 signature in Hex.

    - #### getServerSideEncryption

          public String getServerSideEncryption()

      Gets the object's server side encryption.
      返回:
        The server side encryption. Null means no encryption.

    - #### setServerSideEncryption

          public void setServerSideEncryption(String serverSideEncryption)

      Sets the object's server side encryption.
      参数:
        `serverSideEncryption` - The server side encryption.

    - #### getServerSideEncryptionKeyId

          public String getServerSideEncryptionKeyId()

      Gets the object's server side encryption key ID.
      返回:
        The server side encryption key ID. Null means no encryption key ID.

    - #### setServerSideEncryptionKeyId

          public void setServerSideEncryptionKeyId(String serverSideEncryptionKeyId)

      Sets the object's server side encryption key ID.
      参数:
        `serverSideEncryptionKeyId` - The server side encryption key ID.

    - #### setServerSideDataEncryption

          public void setServerSideDataEncryption(String serverSideDataEncryption)

      Sets the object's server side data encryption.
      参数:
        `serverSideDataEncryption` - The server side data encryption.

    - #### getServerSideDataEncryption

          public String getServerSideDataEncryption()

      Gets the object's server side data encryption.
      返回:
        The server side data encryption. Null means no data encryption.

    - #### getObjectType

          public String getObjectType()

      Gets the object's storage type, which only supports "normal" and "appendable" for now.
      返回:
        Object's storage type.

    - #### setObjectAcl

          public void setObjectAcl(CannedAccessControlList cannedAcl)

      Sets the object ACL. For now it only supports default, private, public-read, public-read-write.
      参数:
        `cannedAcl` - Object ACL.

    - #### getRawMetadata

          public Map<String,Object> getRawMetadata()

      Gets the raw metadata (SDK internal usage only). The value returned is immutable.
      返回:
        The raw metadata object.

    - #### getRequestId

          public String getRequestId()

      Gets the request Id.
      返回:
        RequestId.

    - #### getVersionId

          public String getVersionId()

      Gets the version ID of the associated OSS object if available. Version IDs are only assigned to objects when an object is uploaded to an OSS bucket that has object versioning enabled.
      返回:
        The version ID of the associated OSS object if available.

    - #### getServerCRC

          public Long getServerCRC()

      Gets the service crc.
      返回:
        service crc.

    - #### getObjectStorageClass

          public StorageClass getObjectStorageClass()

      Gets the object's storage class, which is "standard", "IA" or "Archive".
      返回:
        The storage class of the object.

    - #### getObjectRawRestore

          public String getObjectRawRestore()

      Gets the restore status of the object of Archive type.
      返回:
        Object's restore status.

    - #### isRestoreCompleted

          public boolean isRestoreCompleted()

      Gets the flag of completeness of restoring the Archive file.
      返回:
        The flag of completeness of restoring.

    - #### setObjectTagging

          public void setObjectTagging(Map<String,String> tags)

Copyright © 2020. All Rights Reserved.