public class ObjectMetadata
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
AES_256_SERVER_SIDE_ENCRYPTION |
构造器和说明 |
---|
ObjectMetadata() |
限定符和类型 | 方法和说明 |
---|---|
void |
addUserMetadata(java.lang.String key,
java.lang.String value)
Adds a custom metadata.
|
java.lang.String |
getCacheControl()
Gets Cache-Control header value, which specifies the cache behavior of accessing the object.
|
java.lang.String |
getContentDisposition()
Gets Content-Disposition header value, which specifies how MIME agent is going to handle
attachments.
|
java.lang.String |
getContentEncoding()
Gets Content-Encoding header value which means the object content's encoding method.
|
long |
getContentLength()
Gets Content-Length header value which means the object content's size.
|
java.lang.String |
getContentMD5() |
java.lang.String |
getContentType()
Gets Content-Type header value in MIME types, which means the object's type.
|
java.lang.String |
getETag()
Gets the ETag value which is the 128bit MD5 digest in HEX encoding.
|
java.util.Date |
getExpirationTime()
Gets Expires header value in Rfc822 format (EEE, dd MMM yyyy HH:mm:ss 'GMT'")
If the 'expires' header was not assigned with value, returns null.
|
java.util.Date |
getLastModified()
Gets the Last-Modified value, which is the time of the object's last update.
|
java.lang.String |
getObjectType()
Gets Object type---Normal or Appendable
|
java.lang.String |
getRawExpiresValue()
Gets the raw expires header value without parsing it.
|
java.util.Map<java.lang.String,java.lang.Object> |
getRawMetadata()
Gets the raw metadata dictionary (SDK internal only)
|
java.lang.String |
getServerSideEncryption()
Gets the server side encryption algorithm.
|
java.lang.String |
getSHA1() |
java.util.Map<java.lang.String,java.lang.String> |
getUserMetadata()
Gets the user's custom metadata.
|
void |
setCacheControl(java.lang.String cacheControl)
Sets Cache-Control header value, which specifies the cache behavior of accessing the object.
|
void |
setContentDisposition(java.lang.String disposition)
Gets Content-Disposition header value, which specifies how MIME agent is going to handle
attachments.
|
void |
setContentEncoding(java.lang.String encoding)
Gets Content-Encoding header value which means the object content's encoding method.
|
void |
setContentLength(long contentLength)
Sets Content-Length header value which means the object content's size.
|
void |
setContentMD5(java.lang.String contentMD5) |
void |
setContentType(java.lang.String contentType)
Sets Content-Type header value in MIME types, which means the object's type.
|
void |
setExpirationTime(java.util.Date expirationTime)
Sets Expires header value
|
void |
setHeader(java.lang.String key,
java.lang.Object value)
Sets header (SDK internal usage only).
|
void |
setLastModified(java.util.Date lastModified)
Sets the Last-Modified value, which is the time of the object's last update(SDK internal only).
|
void |
setServerSideEncryption(java.lang.String serverSideEncryption)
Sets the server side encryption algorithm.
|
void |
setSHA1(java.lang.String value) |
void |
setUserMetadata(java.util.Map<java.lang.String,java.lang.String> userMetadata)
Sets user's custom metadata.
|
java.lang.String |
toString() |
public static final java.lang.String AES_256_SERVER_SIDE_ENCRYPTION
public java.util.Map<java.lang.String,java.lang.String> getUserMetadata()
Gets the user's custom metadata.
The keys in this userMetadata should include the prefix 'x-oss-meta-'. For example, if customMeta is {uuid:value}, the key should be set to 'x-oss-meta-uuid' Meanwhile the metadata's key is case insensitive and all metadata keys returned from OSS is in lowercase.
public void setUserMetadata(java.util.Map<java.lang.String,java.lang.String> userMetadata)
userMetadata
- User's custom metadatapublic void setHeader(java.lang.String key, java.lang.Object value)
key
- Request Key.value
- Request Value.public void addUserMetadata(java.lang.String key, java.lang.String value)
key
- metadata key
This key should include the prefix "x-oss-meta-"value
- metadata valuepublic java.util.Date getLastModified()
public void setLastModified(java.util.Date lastModified)
lastModified
- The object's last modified time.public java.util.Date getExpirationTime() throws java.text.ParseException
java.text.ParseException
- unable to parse the Expires value into Rfc822 formatpublic void setExpirationTime(java.util.Date expirationTime)
expirationTime
- Expires timepublic java.lang.String getRawExpiresValue()
public long getContentLength()
public void setContentLength(long contentLength)
contentLength
- Object content lengthjava.lang.IllegalArgumentException
- Object content length is more than 5GB or less than 0.public java.lang.String getContentType()
public void setContentType(java.lang.String contentType)
contentType
- The object Content-Type value in MIME types.public java.lang.String getContentMD5()
public void setContentMD5(java.lang.String contentMD5)
public java.lang.String getSHA1()
public void setSHA1(java.lang.String value)
public java.lang.String getContentEncoding()
public void setContentEncoding(java.lang.String encoding)
encoding
- The object content's encoding.public java.lang.String getCacheControl()
public void setCacheControl(java.lang.String cacheControl)
cacheControl
- Cache-Control header valuepublic java.lang.String getContentDisposition()
public void setContentDisposition(java.lang.String disposition)
disposition
- Content-Disposition header valuepublic java.lang.String getETag()
public java.lang.String getServerSideEncryption()
public void setServerSideEncryption(java.lang.String serverSideEncryption)
public java.lang.String getObjectType()
public java.util.Map<java.lang.String,java.lang.Object> getRawMetadata()
public java.lang.String toString()
toString
在类中 java.lang.Object