public class ObjectMetadata extends Object
限定符和类型 | 字段和说明 |
---|---|
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 |
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 |
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 |
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.
|
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.
public void setUserMetadata(Map<String,String> userMetadata)
userMetadata
- The user's custom metadata.public void setHeader(String key, Object value)
key
- The key of headervalue
- The value of the key.public void addUserMetadata(String key, String value)
key
- Key of the header (not starting with x-oss-meta-)value
- The value for the key.public Date getLastModified()
public void setLastModified(Date lastModified)
lastModified
- Object's last modified time.public Date getExpirationTime() throws ParseException
Date
value of the "Expires" header in Rfc822 format. If
expiration is not set, then the value is null.ParseException
- The value is not in the Rfc822 format.public String getRawExpiresValue()
public void setExpirationTime(Date expirationTime)
expirationTime
- Expiration time.public long getContentLength()
public void setContentLength(long contentLength)
contentLength
- Object content size.public String getContentType()
public void setContentType(String contentType)
contentType
- The content-type header in MIME type format.public String getContentMD5()
public void setContentMD5(String contentMD5)
public String getContentEncoding()
public void setContentEncoding(String encoding)
encoding
- Object content's encoding.public String getCacheControl()
public void setCacheControl(String cacheControl)
cacheControl
- Cache-Control header.public String getContentDisposition()
public void setContentDisposition(String disposition)
disposition
- Content-Disposition header.public String getETag()
public String getServerSideEncryption()
public void setServerSideEncryption(String serverSideEncryption)
serverSideEncryption
- The server side encryption.public String getServerSideEncryptionKeyId()
public void setServerSideEncryptionKeyId(String serverSideEncryptionKeyId)
serverSideEncryptionKeyId
- The server side encryption key ID.public String getObjectType()
public void setObjectAcl(CannedAccessControlList cannedAcl)
cannedAcl
- Object ACL.public Map<String,Object> getRawMetadata()
public String getRequestId()
public String getVersionId()
public Long getServerCRC()
public StorageClass getObjectStorageClass()
public String getObjectRawRestore()
public boolean isRestoreCompleted()
Copyright © 2019. All Rights Reserved.