-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.HttpHeaders
public class ProtocolHeaders implements HttpHeadersCreated by vincent on 17-7-26. Copyright @ 2013-2017 Platon AI. All rights reserved
Header information returned from the web server used to serve the content which is subsequently fetched from. This includes keys such as TRANSFER_ENCODING, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_DISPOSITION, CONTENT_MD5, CONTENT_TYPE, LAST_MODIFIED and LOCATION.
-
-
Method Summary
Modifier and Type Method Description static ProtocolHeadersbox(Map<CharSequence, CharSequence> headers)box. Map<CharSequence, CharSequence>unbox()unbox. Stringget(String name)get. StringgetOrDefault(String name, String defaultValue)getOrDefault. voidput(String name, String value)put. voidputAll(Map<String, String> map)putAll. voidputAll(Multimap<String, String> map)putAll. voidremove(String name)remove. InstantgetLastModified()getLastModified. intgetContentLength()getContentLength. StringgetDispositionFilename()Get attachement filename if we see non-standard HTTP header "Content-Disposition".It's a good indication that content provider wants filename thereinbe used as the title of this url.Patterns used to extract filename from possible non-standardHTTP header "Content-Disposition". StringgetDecodedDispositionFilename()getDecodedDispositionFilename. StringgetDecodedDispositionFilename(Charset charset)getDecodedDispositionFilename. voidclear()clear. Map<String, String>asStringMap()asStringMap. StringtoString()-
-
Method Detail
-
box
static ProtocolHeaders box(Map<CharSequence, CharSequence> headers)
box.
- Parameters:
headers- a java.util.Map object.
-
unbox
Map<CharSequence, CharSequence> unbox()
unbox.
-
get
String get(String name)
get.
- Parameters:
name- a java.lang.String object.
-
getOrDefault
String getOrDefault(String name, String defaultValue)
getOrDefault.
- Parameters:
name- a java.lang.String object.defaultValue- a java.lang.String object.
-
put
void put(String name, String value)
put.
- Parameters:
name- a java.lang.String object.value- a java.lang.String object.
-
putAll
void putAll(Map<String, String> map)
putAll.
- Parameters:
map- a java.util.Map object.
-
putAll
void putAll(Multimap<String, String> map)
putAll.
- Parameters:
map- a com.google.common.collect.Multimap object.
-
remove
void remove(String name)
remove.
- Parameters:
name- a java.lang.String object.
-
getLastModified
Instant getLastModified()
getLastModified.
-
getContentLength
int getContentLength()
getContentLength.
-
getDispositionFilename
String getDispositionFilename()
Get attachement filename if we see non-standard HTTP header "Content-Disposition".It's a good indication that content provider wants filename thereinbe used as the title of this url.Patterns used to extract filename from possible non-standardHTTP header "Content-Disposition". Typically it looks like:Content-Disposition: inline; filename="foo.ppt"
-
getDecodedDispositionFilename
String getDecodedDispositionFilename()
getDecodedDispositionFilename.
-
getDecodedDispositionFilename
String getDecodedDispositionFilename(Charset charset)
getDecodedDispositionFilename.
- Parameters:
charset- a java.nio.charset.Charset object.
-
clear
void clear()
clear.
-
asStringMap
Map<String, String> asStringMap()
asStringMap.
-
-
-
-