public static class ContentMetadataCodec.DefaultContentMetadataCodec extends Object implements ContentMetadataCodec
ContentMetadataCodec.DefaultContentMetadataCodec
Constructor and Description |
---|
ContentMetadataCodec.DefaultContentMetadataCodec(DateCodecFactory dateCodecs) |
Modifier and Type | Method and Description |
---|---|
void |
fromHeaders(MutableContentMetadata contentMetadata,
com.google.common.collect.Multimap<String,String> headers)
Sets properties related to the http headers listed in
ContentMetadata.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.
|
protected Logger logger
@Inject public ContentMetadataCodec.DefaultContentMetadataCodec(DateCodecFactory dateCodecs)
protected DateCodec getExpiresDateCodec()
public com.google.common.collect.Multimap<String,String> toHeaders(ContentMetadata md)
ContentMetadataCodec
toHeaders
in interface ContentMetadataCodec
public void fromHeaders(MutableContentMetadata contentMetadata, com.google.common.collect.Multimap<String,String> headers)
ContentMetadataCodec
ContentMetadata.HTTP_HEADERS
fromHeaders
in interface ContentMetadataCodec
public Date parseExpires(String expires)
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.
parseExpires
in interface ContentMetadataCodec
https://tools.ietf.org/html/rfc2616#section-3.3
Copyright © 2009-2018 The Apache Software Foundation. All Rights Reserved.