public class ObjectMetadata extends Object implements Cloneable, Serializable
| Constructor and Description |
|---|
ObjectMetadata() |
ObjectMetadata(Map<String,Object> metadata) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMetaData(String key,
Object value) |
String |
getCacheControl()
Gets the optional Cache-Control HTTP header which allows the user to
specify caching behavior along the HTTP request/reply chain.
|
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.
|
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.
|
String |
getContentLanguage()
Gets the Content-Language HTTP header, which describes the natural language(s) of the
intended audience for the enclosed entity.
|
long |
getContentLength()
Gets the Content-Length HTTP header indicating the size of the
associated object in bytes.
|
String |
getContentMD5()
Gets the base64 encoded 128-bit MD5 digest of the associated object
(content - not including headers) according to RFC 1864.
|
Long[] |
getContentRange()
Returns the content range of the object if response contains the Content-Range header.
|
String |
getContentType()
Gets the Content-Type HTTP header, which indicates the type of content
stored in the associated object.
|
String |
getETag()
Gets the hex encoded 128-bit MD5 digest of the associated object
according to RFC 1864.
|
long |
getInstanceLength()
Returns the physical length of the entire object stored in S3.
|
Date |
getLastModified()
Gets the value of the Last-Modified header, indicating the date
and time at which ObjectStorageClient last recorded a modification to the
associated object.
|
Map<String,Object> |
getRawMetadata()
Gets a map of the raw metadata/headers for the associated object.
|
Object |
getRawMetadataValue(String key)
Returns the raw value of the metadata/headers for the specified key.
|
void |
setCacheControl(String cacheControl)
Sets the optional Cache-Control HTTP header which allows the user to
specify caching behavior along the HTTP request/reply chain.
|
void |
setContentDisposition(String disposition)
Sets the optional Content-Disposition HTTP header, which specifies
presentational information such as the recommended filename for the
object to be saved as.
|
void |
setContentEncoding(String encoding)
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.
|
void |
setContentLanguage(String contentLanguage)
Sets the Content-Language HTTP header which describes the natural language(s) of the
intended audience for the enclosed entity.
|
void |
setContentLength(long contentLength)
Sets the Content-Length HTTP header indicating the size of the
associated object in bytes.
|
void |
setContentMD5(String md5Base64)
Sets the base64 encoded 128-bit MD5 digest of the associated object
(content - not including headers) according to RFC 1864.
|
void |
setContentType(String contentType)
Sets the Content-Type HTTP header indicating the type of content
stored in the associated object.
|
void |
setETag(String ETag) |
void |
setHeader(String key,
Object value)
For internal use only.
|
void |
setLastModified(Date lastModified)
For internal use only.
|
public void setHeader(String key, Object value)
key - The name of the header being set.value - The value for the header.public Map<String,Object> getRawMetadata()
public Object getRawMetadataValue(String key)
public Date getLastModified()
public void setLastModified(Date lastModified)
lastModified - The date and time at which ObjectStorageClient last recorded a
modification to the associated object.public long getContentLength()
Gets the Content-Length HTTP header indicating the size of the associated object in bytes.
This field is required when uploading objects to the storage provider, but the ObjectStorageClient Java client will automatically set it when working directly with files. When uploading directly from a stream, set this field if possible. Otherwise the client must buffer the entire stream in order to calculate the content length before sending the data to ObjectStorageClient.
For more information on the Content-Length HTTP header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
null
if it hasn't been set yet.ObjectMetadata.setContentLength(long)public long getInstanceLength()
public void setContentLength(long contentLength)
Sets the Content-Length HTTP header indicating the size of the associated object in bytes.
This field is required when uploading objects to S3, but the ObjectStorageClient Java client will automatically set it when working directly with files. When uploading directly from a stream, set this field if possible. Otherwise the client must buffer the entire stream in order to calculate the content length before sending the data to ObjectStorageClient.
For more information on the Content-Length HTTP header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
contentLength - The Content-Length HTTP header indicating the size of the
associated object in bytes.ObjectMetadata.getContentLength()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.
When uploading files, the ObjectStorageClient Java client will attempt to determine the correct content type if one hasn't been set yet. Users are responsible for ensuring a suitable content type is set when uploading streams. If no content type is provided and cannot be determined by the filename, the default content type, "application/octet-stream", will be used.
For more information on the Content-Type header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
null
if it hasn't been
set.ObjectMetadata.setContentType(String)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.
When uploading files, the ObjectStorageClient Java client will attempt to determine the correct content type if one hasn't been set yet. Users are responsible for ensuring a suitable content type is set when uploading streams. If no content type is provided and cannot be determined by the filename, the default content type "application/octet-stream" will be used.
For more information on the Content-Type header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
contentType - The HTTP Content-Type header indicating the type of content
stored in the associated storage object.ObjectMetadata.getContentType()public String getContentLanguage()
Gets the Content-Language HTTP header, which describes the natural language(s) of the intended audience for the enclosed entity.
For more information on the Content-Type header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
null
if it hasn't been set.ObjectMetadata.setContentLanguage(String)public void setContentLanguage(String contentLanguage)
Sets the Content-Language HTTP header which describes the natural language(s) of the intended audience for the enclosed entity.
For more information on the Content-Type header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
contentLanguage - The HTTP Content-Language header which describes the natural language(s) of the
intended audience for the enclosed entity.ObjectMetadata.getContentLanguage()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.
For more information on how the Content-Encoding HTTP header works, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
null if it hasn't been set.ObjectMetadata.setContentType(String)public void setContentEncoding(String encoding)
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.
For more information on how the Content-Encoding HTTP header works, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
encoding - The HTTP Content-Encoding header, as defined in RFC 2616.ObjectMetadata.getContentType()public String getCacheControl()
Gets the optional Cache-Control HTTP header which allows the user to specify caching behavior along the HTTP request/reply chain.
For more information on how the Cache-Control HTTP header affects HTTP requests and responses, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
null if
it hasn't been set.ObjectMetadata.setCacheControl(String)public void setCacheControl(String cacheControl)
Sets the optional Cache-Control HTTP header which allows the user to specify caching behavior along the HTTP request/reply chain.
For more information on how the Cache-Control HTTP header affects HTTP requests and responses see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
cacheControl - The HTTP Cache-Control header as defined in RFC 2616.ObjectMetadata.getCacheControl()public void setContentMD5(String md5Base64)
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 ObjectStorageClient is the same data that the caller sent. If set to null,then the MD5 digest is removed from the metadata.
This field represents the base64 encoded 128-bit MD5 digest digest of an object's content as calculated on the caller's side. The ETag metadata field represents the hex encoded 128-bit MD5 digest as computed by Amazon S3.
The ObjectStorageClient Java client will attempt to calculate this field automatically when uploading files to ObjectStorageClient.
md5Base64 - The base64 encoded MD5 hash of the content for the object
associated with this metadata.ObjectMetadata.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 ObjectStorageClient is the same data that the caller sent.
This field represents the base64 encoded 128-bit MD5 digest digest of an object's content as calculated on the caller's side. The ETag metadata field represents the hex encoded 128-bit MD5 digest as computed by Amazon S3.
The ObjectStorageClient Java client will attempt to calculate this field automatically when uploading files to ObjectStorageClient.
null if the MD5 hash of the content
hasn't been set.ObjectMetadata.setContentMD5(String)public void setContentDisposition(String disposition)
Sets the optional Content-Disposition HTTP header, which specifies presentational information such as the recommended filename for the object to be saved as.
For more information on how the Content-Disposition header affects HTTP client behavior, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
disposition - The value for the Content-Disposition header.ObjectMetadata.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.
For more information on how the Content-Disposition header affects HTTP client behavior, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
null if the Content-Disposition header
hasn't been set.ObjectMetadata.setCacheControl(String)public String getETag()
This field represents the hex encoded 128-bit MD5 digest of an object's content as calculated by ObjectStorageClient. The ContentMD5 field represents the base64 encoded 128-bit MD5 digest as calculated on the caller's side.
null if it hasn't been set yet.public void setETag(String ETag)
public Long[] getContentRange()
Returns the content range of the object if response contains the Content-Range header.
If the request specifies a range or part number, then response returns the Content-Range range header. Otherwise, the response does not return Content-Range header.
Copyright © 2017. All rights reserved.