com.google.api.client.http
Class HttpHeaders

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.http.HttpHeaders
All Implemented Interfaces:
Cloneable, Map<String,Object>

public class HttpHeaders
extends GenericData

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.

Since:
1.0
Author:
Yaniv Inbar

Nested Class Summary
 
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.
 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.
 String 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.
 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(String 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, 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

HttpHeaders

public HttpHeaders()
Method Detail

clone

public HttpHeaders clone()
Description copied from class: GenericData
Makes a "deep" clone of the generic data, in which the clone is completely independent of the original.

Overrides:
clone in class GenericData

getAccept

public final String getAccept()
Returns the "Accept" header or null for none.

Since:
1.5

setAccept

public final void setAccept(String accept)
Sets the "Accept" header or null for none.

Since:
1.5

getAcceptEncoding

public final String getAcceptEncoding()
Returns the "Accept-Encoding" header or null for none.

Since:
1.5

setAcceptEncoding

public final void setAcceptEncoding(String acceptEncoding)
Sets the "Accept-Encoding" header or null for none.

By default, this is "gzip".

Since:
1.5

getAuthorization

public final String getAuthorization()
Returns the "Authorization" header or null for none.

Since:
1.5

setAuthorization

public final void setAuthorization(String authorization)
Sets the "Authorization" header or null for none.

Since:
1.5

getCacheControl

public final String getCacheControl()
Returns the "Cache-Control" header or null for none.

Since:
1.5

setCacheControl

public final void setCacheControl(String cacheControl)
Sets the "Cache-Control" header or null for none.

Since:
1.5

getContentEncoding

public final String getContentEncoding()
Returns the "Content-Encoding" header or null for none.

Since:
1.5

setContentEncoding

public final void setContentEncoding(String contentEncoding)
Sets the "Content-Encoding" header or null for none.

Since:
1.5

getContentLength

public final String getContentLength()
Returns the "Content-Length" header or null for none.

Since:
1.5

setContentLength

public final void setContentLength(String contentLength)
Sets the "Content-Length" header or null for none.

Since:
1.5

getContentMD5

public final String getContentMD5()
Returns the "Content-MD5" header or null for none.

Since:
1.5

setContentMD5

public final void setContentMD5(String contentMD5)
Sets the "Content-MD5" header or null for none.

Since:
1.5

getContentRange

public final String getContentRange()
Returns the "Content-Range" header or null for none.

Since:
1.5

setContentRange

public final void setContentRange(String contentRange)
Sets the "Content-Range" header or null for none.

Since:
1.5

getContentType

public final String getContentType()
Returns the "Content-Type" header or null for none.

Since:
1.5

setContentType

public final void setContentType(String contentType)
Sets the "Content-Type" header or null for none.

Since:
1.5

getCookie

public final String getCookie()
Returns the "Cookie" header or null for none. See Cookie Specification.

Since:
1.6

setCookie

public final void setCookie(String cookie)
Sets the "Cookie" header or null for none.

Since:
1.6

getDate

public final String getDate()
Returns the "Date" header or null for none.

Since:
1.5

setDate

public final void setDate(String date)
Sets the "Date" header or null for none.

Since:
1.5

getETag

public final String getETag()
Returns the "ETag" header or null for none.

Since:
1.5

setETag

public final void setETag(String etag)
Sets the "ETag" header or null for none.

Since:
1.5

getExpires

public final String getExpires()
Returns the "Expires" header or null for none.

Since:
1.5

setExpires

public final void setExpires(String expires)
Sets the "Expires" header or null for none.

Since:
1.5

getIfModifiedSince

public final String getIfModifiedSince()
Returns the "If-Modified-Since" header or null for none.

Since:
1.5

setIfModifiedSince

public final void setIfModifiedSince(String ifModifiedSince)
Sets the "If-Modified-Since" header or null for none.

Since:
1.5

getIfMatch

public final String getIfMatch()
Returns the "If-Match" header or null for none.

Since:
1.5

setIfMatch

public final void setIfMatch(String ifMatch)
Sets the "If-Match" header or null for none.

Since:
1.5

getIfNoneMatch

public final String getIfNoneMatch()
Returns the "If-None-Match" header or null for none.

Since:
1.5

setIfNoneMatch

public final void setIfNoneMatch(String ifNoneMatch)
Sets the "If-None-Match" header or null for none.

Since:
1.5

getIfUnmodifiedSince

public final String getIfUnmodifiedSince()
Returns the "If-Unmodified-Since" header or null for none.

Since:
1.5

setIfUnmodifiedSince

public final void setIfUnmodifiedSince(String ifUnmodifiedSince)
Sets the "If-Unmodified-Since" header or null for none.

Since:
1.5

getLastModified

public final String getLastModified()
Returns the "Last-Modified" header or null for none.

Since:
1.5

setLastModified

public final void setLastModified(String lastModified)
Sets the "Last-Modified" header or null for none.

Since:
1.5

getLocation

public final String getLocation()
Returns the "Location" header or null for none.

Since:
1.5

setLocation

public final void setLocation(String location)
Sets the "Location" header or null for none.

Since:
1.5

getMimeVersion

public final String getMimeVersion()
Returns the "MIME-Version" header or null for none.

Since:
1.5

setMimeVersion

public final void setMimeVersion(String mimeVersion)
Sets the "MIME-Version" header or null for none.

Since:
1.5

getRange

public final String getRange()
Returns the "Range" header or null for none.

Since:
1.5

setRange

public final void setRange(String range)
Sets the "Range" header or null for none.

Since:
1.5

getRetryAfter

public final String getRetryAfter()
Returns the "Retry-After" header or null for none.

Since:
1.5

setRetryAfter

public final void setRetryAfter(String retryAfter)
Sets the "Retry-After" header or null for none.

Since:
1.5

getUserAgent

public final String getUserAgent()
Returns the "User-Agent" header or null for none.

Since:
1.5

setUserAgent

public final void setUserAgent(String userAgent)
Sets the "User-Agent" header or null for none.

Since:
1.5

getAuthenticate

public final String getAuthenticate()
Returns the "WWW-Authenticate" header or null for none.

Since:
1.5

setAuthenticate

public final void setAuthenticate(String authenticate)
Sets the "WWW-Authenticate" header or null for none.

Since:
1.5

setBasicAuthentication

public final void setBasicAuthentication(String username,
                                         String password)
Sets the authorization header as specified in Basic Authentication Scheme.

Since:
1.2


Copyright © 2011-2012 Google. All Rights Reserved.