org.jclouds.io.payloads
Class BaseImmutableContentMetadata

java.lang.Object
  extended by org.jclouds.io.payloads.BaseImmutableContentMetadata
All Implemented Interfaces:
Serializable, ContentMetadata

public class BaseImmutableContentMetadata
extends Object
implements ContentMetadata, Serializable

Author:
Adrian Cole
See Also:
Serialized Form

Field Summary
protected  String contentDisposition
           
protected  String contentEncoding
           
protected  String contentLanguage
           
protected  Long contentLength
           
protected  byte[] contentMD5
           
protected  String contentType
           
 
Fields inherited from interface org.jclouds.io.ContentMetadata
HTTP_HEADERS
 
Constructor Summary
BaseImmutableContentMetadata(String contentType, Long contentLength, byte[] contentMD5, String contentDisposition, String contentLanguage, String contentEncoding)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getContentDisposition()
          Specifies presentational information for the object.
 String getContentEncoding()
          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 header field.
 String getContentLanguage()
          Get Content Language of the payload

Not all providers may support it

 Long getContentLength()
          Returns the total size of the payload, or the chunk that's available.
 byte[] getContentMD5()
          
 String getContentType()
          A standard MIME type describing the format of the contents.
 int hashCode()
           
 ContentMetadataBuilder toBuilder()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

contentType

protected String contentType

contentLength

protected Long contentLength

contentMD5

protected byte[] contentMD5

contentDisposition

protected String contentDisposition

contentLanguage

protected String contentLanguage

contentEncoding

protected String contentEncoding
Constructor Detail

BaseImmutableContentMetadata

public BaseImmutableContentMetadata(String contentType,
                                    Long contentLength,
                                    byte[] contentMD5,
                                    String contentDisposition,
                                    String contentLanguage,
                                    String contentEncoding)
Method Detail

getContentLength

public Long getContentLength()
Returns the total size of the payload, or the chunk that's available.

Chunking is only used when org.jclouds.http.GetOptions is called with options like tail, range, or startAt.

Specified by:
getContentLength in interface ContentMetadata
Returns:
the length in bytes that can be be obtained from #getInput()
See Also:
HttpHeaders.CONTENT_LENGTH, GetOptions

getContentMD5

public byte[] getContentMD5()

Specified by:
getContentMD5 in interface ContentMetadata

getContentType

public String getContentType()
A standard MIME type describing the format of the contents. If none is provided, the default is binary/octet-stream.

Specified by:
getContentType in interface ContentMetadata
See Also:

getContentDisposition

public String getContentDisposition()
Specifies presentational information for the object.

Specified by:
getContentDisposition in interface ContentMetadata
See Also:

getContentLanguage

public String getContentLanguage()
Get Content Language of the payload

Not all providers may support it

Specified by:
getContentLanguage in interface ContentMetadata

getContentEncoding

public String getContentEncoding()
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 header field.

Specified by:
getContentEncoding in interface ContentMetadata
See Also:

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toBuilder

public ContentMetadataBuilder toBuilder()
Specified by:
toBuilder in interface ContentMetadata


Copyright © 2009-2012 jclouds. All Rights Reserved.