|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
com.google.api.client.http.HttpHeaders
public class HttpHeaders
Stores HTTP headers used in an HTTP request or response, as defined in Header Field Definitions.
null
is not allowed as a name or value of a header. Names are case-insensitive.
Implementation is not thread-safe.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData |
---|
GenericData.Flags |
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Constructor Summary | |
---|---|
HttpHeaders()
|
Method Summary | |
---|---|
HttpHeaders |
clone()
Makes a "deep" clone of the generic data, in which the clone is completely independent of the original. |
void |
fromHttpHeaders(HttpHeaders headers)
Puts all headers of the HttpHeaders object into this HttpHeaders object. |
void |
fromHttpResponse(LowLevelHttpResponse response,
StringBuilder logger)
Puts all headers of the LowLevelHttpResponse into this HttpHeaders object. |
String |
getAccept()
Returns the "Accept" header or null for none. |
String |
getAcceptEncoding()
Returns the "Accept-Encoding" header or null for none. |
String |
getAuthenticate()
Returns the "WWW-Authenticate" header or null for none. |
String |
getAuthorization()
Returns the "Authorization" header or null for none. |
String |
getCacheControl()
Returns the "Cache-Control" header or null for none. |
String |
getContentEncoding()
Returns the "Content-Encoding" header or null for none. |
Long |
getContentLength()
Returns the "Content-Length" header or null for none. |
String |
getContentMD5()
Returns the "Content-MD5" header or null for none. |
String |
getContentRange()
Returns the "Content-Range" header or null for none. |
String |
getContentType()
Returns the "Content-Type" header or null for none. |
String |
getCookie()
Returns the "Cookie" header or null for none. |
String |
getDate()
Returns the "Date" header or null for none. |
String |
getETag()
Returns the "ETag" header or null for none. |
String |
getExpires()
Returns the "Expires" header or null for none. |
String |
getIfMatch()
Returns the "If-Match" header or null for none. |
String |
getIfModifiedSince()
Returns the "If-Modified-Since" header or null for none. |
String |
getIfNoneMatch()
Returns the "If-None-Match" header or null for none. |
String |
getIfUnmodifiedSince()
Returns the "If-Unmodified-Since" header or null for none. |
String |
getLastModified()
Returns the "Last-Modified" header or null for none. |
String |
getLocation()
Returns the "Location" header or null for none. |
String |
getMimeVersion()
Returns the "MIME-Version" header or null for none. |
String |
getRange()
Returns the "Range" header or null for none. |
String |
getRetryAfter()
Returns the "Retry-After" header or null for none. |
String |
getUserAgent()
Returns the "User-Agent" header or null for none. |
static void |
serializeHeaders(HttpHeaders headers,
StringBuilder logbuf,
Logger logger,
LowLevelHttpRequest lowLevelHttpRequest)
Serializes headers to an @{link LowLevelHttpRequest}. |
static void |
serializeHeadersForMultipartRequests(HttpHeaders headers,
StringBuilder logbuf,
Logger logger,
Writer writer)
Serializes headers to an Writer for Multi-part requests. |
void |
setAccept(String accept)
Sets the "Accept" header or null for none. |
void |
setAcceptEncoding(String acceptEncoding)
Sets the "Accept-Encoding" header or null for none. |
void |
setAuthenticate(String authenticate)
Sets the "WWW-Authenticate" header or null for none. |
void |
setAuthorization(String authorization)
Sets the "Authorization" header or null for none. |
void |
setBasicAuthentication(String username,
String password)
Sets the authorization header as specified in Basic Authentication Scheme. |
void |
setCacheControl(String cacheControl)
Sets the "Cache-Control" header or null for none. |
void |
setContentEncoding(String contentEncoding)
Sets the "Content-Encoding" header or null for none. |
void |
setContentLength(Long contentLength)
Sets the "Content-Length" header or null for none. |
void |
setContentMD5(String contentMD5)
Sets the "Content-MD5" header or null for none. |
void |
setContentRange(String contentRange)
Sets the "Content-Range" header or null for none. |
void |
setContentType(String contentType)
Sets the "Content-Type" header or null for none. |
void |
setCookie(String cookie)
Sets the "Cookie" header or null for none. |
void |
setDate(String date)
Sets the "Date" header or null for none. |
void |
setETag(String etag)
Sets the "ETag" header or null for none. |
void |
setExpires(String expires)
Sets the "Expires" header or null for none. |
void |
setIfMatch(String ifMatch)
Sets the "If-Match" header or null for none. |
void |
setIfModifiedSince(String ifModifiedSince)
Sets the "If-Modified-Since" header or null for none. |
void |
setIfNoneMatch(String ifNoneMatch)
Sets the "If-None-Match" header or null for none. |
void |
setIfUnmodifiedSince(String ifUnmodifiedSince)
Sets the "If-Unmodified-Since" header or null for none. |
void |
setLastModified(String lastModified)
Sets the "Last-Modified" header or null for none. |
void |
setLocation(String location)
Sets the "Location" header or null for none. |
void |
setMimeVersion(String mimeVersion)
Sets the "MIME-Version" header or null for none. |
void |
setRange(String range)
Sets the "Range" header or null for none. |
void |
setRetryAfter(String retryAfter)
Sets the "Retry-After" header or null for none. |
void |
setUserAgent(String userAgent)
Sets the "User-Agent" header or null for none. |
Methods inherited from class com.google.api.client.util.GenericData |
---|
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, set, setUnknownKeys |
Methods inherited from class java.util.AbstractMap |
---|
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, toString, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HttpHeaders()
Method Detail |
---|
public HttpHeaders clone()
GenericData
clone
in class GenericData
public final String getAccept()
"Accept"
header or null
for none.
public final void setAccept(String accept)
"Accept"
header or null
for none.
public final String getAcceptEncoding()
"Accept-Encoding"
header or null
for none.
public final void setAcceptEncoding(String acceptEncoding)
"Accept-Encoding"
header or null
for none.
By default, this is "gzip"
.
public final String getAuthorization()
"Authorization"
header or null
for none.
public final void setAuthorization(String authorization)
"Authorization"
header or null
for none.
public final String getCacheControl()
"Cache-Control"
header or null
for none.
public final void setCacheControl(String cacheControl)
"Cache-Control"
header or null
for none.
public final String getContentEncoding()
"Content-Encoding"
header or null
for none.
public final void setContentEncoding(String contentEncoding)
"Content-Encoding"
header or null
for none.
public final Long getContentLength()
"Content-Length"
header or null
for none.
Upgrade warning: in prior version content length was represented as a String, but now it is represented as a Long.
public final void setContentLength(Long contentLength)
"Content-Length"
header or null
for none.
Upgrade warning: in prior version content length was represented as a String, but now it is represented as a Long.
public final String getContentMD5()
"Content-MD5"
header or null
for none.
public final void setContentMD5(String contentMD5)
"Content-MD5"
header or null
for none.
public final String getContentRange()
"Content-Range"
header or null
for none.
public final void setContentRange(String contentRange)
"Content-Range"
header or null
for none.
public final String getContentType()
"Content-Type"
header or null
for none.
public final void setContentType(String contentType)
"Content-Type"
header or null
for none.
public final String getCookie()
"Cookie"
header or null
for none.
See Cookie Specification.
public final void setCookie(String cookie)
"Cookie"
header or null
for none.
public final String getDate()
"Date"
header or null
for none.
public final void setDate(String date)
"Date"
header or null
for none.
public final String getETag()
"ETag"
header or null
for none.
public final void setETag(String etag)
"ETag"
header or null
for none.
public final String getExpires()
"Expires"
header or null
for none.
public final void setExpires(String expires)
"Expires"
header or null
for none.
public final String getIfModifiedSince()
"If-Modified-Since"
header or null
for none.
public final void setIfModifiedSince(String ifModifiedSince)
"If-Modified-Since"
header or null
for none.
public final String getIfMatch()
"If-Match"
header or null
for none.
public final void setIfMatch(String ifMatch)
"If-Match"
header or null
for none.
public final String getIfNoneMatch()
"If-None-Match"
header or null
for none.
public final void setIfNoneMatch(String ifNoneMatch)
"If-None-Match"
header or null
for none.
public final String getIfUnmodifiedSince()
"If-Unmodified-Since"
header or null
for none.
public final void setIfUnmodifiedSince(String ifUnmodifiedSince)
"If-Unmodified-Since"
header or null
for none.
public final String getLastModified()
"Last-Modified"
header or null
for none.
public final void setLastModified(String lastModified)
"Last-Modified"
header or null
for none.
public final String getLocation()
"Location"
header or null
for none.
public final void setLocation(String location)
"Location"
header or null
for none.
public final String getMimeVersion()
"MIME-Version"
header or null
for none.
public final void setMimeVersion(String mimeVersion)
"MIME-Version"
header or null
for none.
public final String getRange()
"Range"
header or null
for none.
public final void setRange(String range)
"Range"
header or null
for none.
public final String getRetryAfter()
"Retry-After"
header or null
for none.
public final void setRetryAfter(String retryAfter)
"Retry-After"
header or null
for none.
public final String getUserAgent()
"User-Agent"
header or null
for none.
public final void setUserAgent(String userAgent)
"User-Agent"
header or null
for none.
public final String getAuthenticate()
"WWW-Authenticate"
header or null
for none.
public final void setAuthenticate(String authenticate)
"WWW-Authenticate"
header or null
for none.
public final void setBasicAuthentication(String username, String password)
authorization
header as specified in Basic Authentication Scheme.
public static void serializeHeaders(HttpHeaders headers, StringBuilder logbuf, Logger logger, LowLevelHttpRequest lowLevelHttpRequest) throws IOException
headers
- HTTP headerslogbuf
- log buffer or null
for nonelogger
- logger or null
for none. Logger must be specified if log buffer is
specifiedlowLevelHttpRequest
- low level HTTP request where HTTP headers will be serialized to or
null
for none
IOException
public static void serializeHeadersForMultipartRequests(HttpHeaders headers, StringBuilder logbuf, Logger logger, Writer writer) throws IOException
Writer
for Multi-part requests.
headers
- HTTP headerslogbuf
- log buffer or null
for nonelogger
- logger or null
for none. Logger must be specified if log buffer is
specifiedwriter
- Writer where HTTP headers will be serialized to or null
for none
IOException
public final void fromHttpResponse(LowLevelHttpResponse response, StringBuilder logger)
LowLevelHttpResponse
into this HttpHeaders
object.
response
- Response from which the headers are copiedlogger
- StringBuilder
to which logging output is added or null
to disable
loggingpublic final void fromHttpHeaders(HttpHeaders headers)
HttpHeaders
object into this HttpHeaders
object.
headers
- HttpHeaders
from where the headers are taken
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |