|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.services.s3.model.ObjectMetadata
public class ObjectMetadata
Represents the metadata that Amazon S3 stores for an object. This includes custom user-supplied metadata, as well as the standard HTTP headers that Amazon S3 sends and receives (Content-Length, ETag, Content-MD5, etc.).
Constructor Summary | |
---|---|
ObjectMetadata()
|
Method Summary | |
---|---|
void |
addUserMetadata(String key,
String value)
Adds the key value pair of custom user metadata for the associated object. |
String |
getCacheControl()
Returns the optional Cache-Control HTTP header which allows the user to specify caching behavior along the HTTP request/reply chain. |
String |
getContentDisposition()
Returns 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()
Returns the optional Content-Encoding HTTP header, which specifies what content encodings have been applied to the object, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type field. |
long |
getContentLength()
Returns the Content-Length HTTP header which indicates the size of the associated object in bytes. |
String |
getContentMD5()
Returns the base64 encoded 128-bit MD5 digest of the associated object (content - not including headers) according to RFC 1864. |
String |
getContentType()
Returns the Content-Type HTTP header, which indicates the type of content stored in the associated object. |
String |
getETag()
Returns the hex encoded 128-bit MD5 digest of the associated object according to RFC 1864. |
Date |
getLastModified()
Returns the value of the Last-Modified header, which indicates the date and time at which Amazon S3 last recorded a modification to the associated object. |
Map<String,Object> |
getRawMetadata()
For internal use only. |
Map<String,String> |
getUserMetadata()
Gets all the custom user metadata for the associated object. |
String |
getVersionId()
Returns the version ID of the associated Amazon S3 object, if available. |
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, which specifies what content encodings have been applied to the object, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type field. |
void |
setContentLength(long contentLength)
Sets the Content-Length HTTP header which indicates 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, which indicates the type of content stored in the associated object. |
void |
setHeader(String key,
Object value)
For internal use only. |
void |
setLastModified(Date lastModified)
For internal use only. |
void |
setUserMetadata(Map<String,String> userMetadata)
Sets the custom user metadata for the associated object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectMetadata()
Method Detail |
---|
public Map<String,String> getUserMetadata()
Gets all the custom user metadata for the associated object.
Amazon S3 can store additional metadata on objects by internally representing it as HTTP headers prefixed with "x-amz-meta-". Callers can use user metadata to store arbitrary metadata alongside their data in Amazon S3. When setting user metadata, callers should not include the internal "x-amz-meta-" prefix, as this library will handle that for them. Likewise, when callers retrieve custom user metadata, they will not see the "x-amz-meta-" header prefix.
Note that user metadata for an object is limited by the HTTP request header limit. All HTTP headers included in a request (including user metadata headers and other standard HTTP headers) must be less than 8KB.
public void setUserMetadata(Map<String,String> userMetadata)
Amazon S3 can store additional metadata on objects by internally representing it as HTTP headers prefixed with "x-amz-meta-". Callers can use user metadata to store arbitrary metadata alongside their data in Amazon S3. When setting user metadata, callers should not include the internal "x-amz-meta-" prefix, as this library will handle that for them. Likewise, when callers retrieve custom user metadata, they will not see the "x-amz-meta-" header prefix.
Note that user metadata for an object is limited by the HTTP request header limit. All HTTP headers included in a request (including user metadata headers and other standard HTTP headers) must be less than 8KB.
userMetadata
- The custom user metadata for the associated object.public void setHeader(String key, Object value)
key
- The name of the header being set.value
- The value for the header.public void addUserMetadata(String key, String value)
Amazon S3 can store additional metadata on objects by internally representing it as HTTP headers prefixed with "x-amz-meta-". Callers can use user metadata to store arbitrary metadata alongside their data in Amazon S3. When setting user metadata, callers should not include the internal "x-amz-meta-" prefix, as this library will handle that for them. Likewise, when callers retrieve custom user metadata, they will not see the "x-amz-meta-" header prefix.
Note that user metadata for an object is limited by the HTTP request header limit. All HTTP headers included in a request (including user metadata headers and other standard HTTP headers) must be less than 8KB.
key
- The key for the custom user metadata entry (should not include
the internal S3 HTTP header prefix).value
- The value for the custom user metadata entry.public Map<String,Object> getRawMetadata()
public Date getLastModified()
public void setLastModified(Date lastModified)
lastModified
- The date and time at which Amazon S3 last recorded a
modification to the associated object.public long getContentLength()
This field is required when uploading objects to S3, but the AWS S3 Java client will automatically set it when working directly with files. When uploading directly from a stream the caller should set this field if possible, otherwise the client will have to buffer the entire stream in order to calculate the content length before it can send the data to Amazon S3.
For more information on the Content-Length HTTP header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
public void setContentLength(long contentLength)
This field is required when uploading objects to S3, but the AWS S3 Java client will automatically set it when working directly with files. When uploading directly from a stream the caller should set this field if possible, otherwise the client will have to buffer the entire stream in order to calculate the content length before it can send the data to Amazon S3.
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.public String getContentType()
When uploading files, the AWS S3 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 filename, then 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
public void setContentType(String contentType)
When uploading files, the AWS S3 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 filename, then 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 S3 object.public String getContentEncoding()
For more information on how the Content-Encoding HTTP header works, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
public void setContentEncoding(String encoding)
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.public String getCacheControl()
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
public void setCacheControl(String cacheControl)
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.public void setContentMD5(String md5Base64)
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 AWS S3 Java client will attempt to calculate this field automatically when uploading files to Amazon S3.
md5Base64
- The base64 encoded MD5 hash of the content for the object
associated with this metadata.public String getContentMD5()
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 AWS S3 Java client will attempt to calculate this field automatically when uploading files to Amazon S3.
public void setContentDisposition(String disposition)
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.public String getContentDisposition()
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
public String getETag()
This field represents the hex encoded 128-bit MD5 digest of an object's content as calculated by Amazon S3. The ContentMD5 field represents the base64 encoded 128-bit MD5 digest as calculated on the caller's side.
public String getVersionId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |