Package org.jclouds.io
Class ContentMetadataCodec.DefaultContentMetadataCodec
- java.lang.Object
-
- org.jclouds.io.ContentMetadataCodec.DefaultContentMetadataCodec
-
- All Implemented Interfaces:
ContentMetadataCodec
- Enclosing interface:
- ContentMetadataCodec
public static class ContentMetadataCodec.DefaultContentMetadataCodec extends Object implements ContentMetadataCodec
Default implementation, in accordance with HTTP 1.1 spec.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jclouds.io.ContentMetadataCodec
ContentMetadataCodec.DefaultContentMetadataCodec
-
-
Constructor Summary
Constructors Constructor Description DefaultContentMetadataCodec(DateCodecFactory dateCodecs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fromHeaders(MutableContentMetadata contentMetadata, com.google.common.collect.Multimap<String,String> headers)
Sets properties related to the http headers listed inContentMetadata.HTTP_HEADERS
protected DateCodec
getExpiresDateCodec()
protected List<DateCodec>
getExpiresDateDecoders()
Date
parseExpires(String expires)
Parses the date from the given Expires header.com.google.common.collect.Multimap<String,String>
toHeaders(ContentMetadata md)
Generates standard HTTP headers for the give metadata.
-
-
-
Field Detail
-
logger
protected Logger logger
-
-
Constructor Detail
-
DefaultContentMetadataCodec
@Inject public DefaultContentMetadataCodec(DateCodecFactory dateCodecs)
-
-
Method Detail
-
getExpiresDateCodec
protected DateCodec getExpiresDateCodec()
-
toHeaders
public com.google.common.collect.Multimap<String,String> toHeaders(ContentMetadata md)
Description copied from interface:ContentMetadataCodec
Generates standard HTTP headers for the give metadata.- Specified by:
toHeaders
in interfaceContentMetadataCodec
-
fromHeaders
public void fromHeaders(MutableContentMetadata contentMetadata, com.google.common.collect.Multimap<String,String> headers)
Description copied from interface:ContentMetadataCodec
Sets properties related to the http headers listed inContentMetadata.HTTP_HEADERS
- Specified by:
fromHeaders
in interfaceContentMetadataCodec
-
parseExpires
public Date parseExpires(String expires)
Parses the date from the given Expires header.According to the RFC, dates should always come in RFC-1123 format. However, clients should also support older and deprecated formats for compatibility, so this method will try to parse an RFC-1123 date, and fallback to the ANSI C format.
- Specified by:
parseExpires
in interfaceContentMetadataCodec
-
-