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>
 
Field Summary
 String accept
          Deprecated. (scheduled to be made private in 1.6) Use getAccept() or setAccept(java.lang.String)
 String acceptEncoding
          Deprecated. (scheduled to be made private in 1.6) Use getAcceptEncoding() or setAcceptEncoding(java.lang.String)
 String authenticate
          Deprecated. (scheduled to be made private in 1.6) Use getAuthenticate() or setAuthenticate(java.lang.String)
 String authorization
          Deprecated. (scheduled to be made private in 1.6) Use getAuthorization() or setAuthorization(java.lang.String)
 String cacheControl
          Deprecated. (scheduled to be made private in 1.6) Use getCacheControl() or setCacheControl(java.lang.String)
 String contentEncoding
          Deprecated. (scheduled to be made private in 1.6) Use getContentEncoding() or setContentEncoding(java.lang.String)
 String contentLength
          Deprecated. (scheduled to be made private in 1.6) Use getContentLength() or setContentLength(java.lang.String)
 String contentMD5
          Deprecated. (scheduled to be made private in 1.6) Use getContentMD5() or setContentMD5(java.lang.String)
 String contentRange
          Deprecated. (scheduled to be made private in 1.6) Use getContentRange() or setContentRange(java.lang.String)
 String contentType
          Deprecated. (scheduled to be made private in 1.6) Use getContentType() or setContentType(java.lang.String)
 String date
          Deprecated. (scheduled to be made private in 1.6) Use getDate() or setDate(java.lang.String)
 String etag
          Deprecated. (scheduled to be made private in 1.6) Use getETag() or setETag(java.lang.String)
 String expires
          Deprecated. (scheduled to be made private in 1.6) Use getExpires() or setExpires(java.lang.String)
 String ifMatch
          Deprecated. (scheduled to be made private in 1.6) Use getIfMatch() or setIfMatch(java.lang.String)
 String ifModifiedSince
          Deprecated. (scheduled to be made private in 1.6) Use getIfModifiedSince() or setIfModifiedSince(java.lang.String)
 String ifNoneMatch
          Deprecated. (scheduled to be made private in 1.6) Use getIfNoneMatch() or setIfNoneMatch(java.lang.String)
 String ifUnmodifiedSince
          Deprecated. (scheduled to be made private in 1.6) Use getIfUnmodifiedSince() or setIfUnmodifiedSince(java.lang.String)
 String lastModified
          Deprecated. (scheduled to be made private in 1.6) Use getLastModified() or setLastModified(java.lang.String)
 String location
          Deprecated. (scheduled to be made private in 1.6) Use getLocation() or setLocation(java.lang.String)
 String mimeVersion
          Deprecated. (scheduled to be made private in 1.6) Use getMimeVersion() or setMimeVersion(java.lang.String)
 String range
          Deprecated. (scheduled to be made private in 1.6) Use getRange() or setRange(java.lang.String)
 String retryAfter
          Deprecated. (scheduled to be made private in 1.6) Use getRetryAfter() or setRetryAfter(java.lang.String)
 String userAgent
          Deprecated. (scheduled to be made private in 1.6) Use getUserAgent() or setUserAgent(java.lang.String)
 
Fields inherited from class com.google.api.client.util.GenericData
unknownFields
 
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 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 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
 

Field Detail

accept

@Deprecated
public String accept
Deprecated. (scheduled to be made private in 1.6) Use getAccept() or setAccept(java.lang.String)
"Accept" header.


acceptEncoding

@Deprecated
public String acceptEncoding
Deprecated. (scheduled to be made private in 1.6) Use getAcceptEncoding() or setAcceptEncoding(java.lang.String)
"Accept-Encoding" header. By default, this is "gzip".


authorization

@Deprecated
public String authorization
Deprecated. (scheduled to be made private in 1.6) Use getAuthorization() or setAuthorization(java.lang.String)
"Authorization" header.


cacheControl

@Deprecated
public String cacheControl
Deprecated. (scheduled to be made private in 1.6) Use getCacheControl() or setCacheControl(java.lang.String)
"Cache-Control" header.


contentEncoding

@Deprecated
public String contentEncoding
Deprecated. (scheduled to be made private in 1.6) Use getContentEncoding() or setContentEncoding(java.lang.String)
"Content-Encoding" header.


contentLength

@Deprecated
public String contentLength
Deprecated. (scheduled to be made private in 1.6) Use getContentLength() or setContentLength(java.lang.String)
"Content-Length" header.


contentMD5

@Deprecated
public String contentMD5
Deprecated. (scheduled to be made private in 1.6) Use getContentMD5() or setContentMD5(java.lang.String)
"Content-MD5" header.


contentRange

@Deprecated
public String contentRange
Deprecated. (scheduled to be made private in 1.6) Use getContentRange() or setContentRange(java.lang.String)
"Content-Range" header.


contentType

@Deprecated
public String contentType
Deprecated. (scheduled to be made private in 1.6) Use getContentType() or setContentType(java.lang.String)
"Content-Type" header.


date

@Deprecated
public String date
Deprecated. (scheduled to be made private in 1.6) Use getDate() or setDate(java.lang.String)
"Date" header.


etag

@Deprecated
public String etag
Deprecated. (scheduled to be made private in 1.6) Use getETag() or setETag(java.lang.String)
"ETag" header.


expires

@Deprecated
public String expires
Deprecated. (scheduled to be made private in 1.6) Use getExpires() or setExpires(java.lang.String)
"Expires" header.


ifModifiedSince

@Deprecated
public String ifModifiedSince
Deprecated. (scheduled to be made private in 1.6) Use getIfModifiedSince() or setIfModifiedSince(java.lang.String)
"If-Modified-Since" header.


ifMatch

@Deprecated
public String ifMatch
Deprecated. (scheduled to be made private in 1.6) Use getIfMatch() or setIfMatch(java.lang.String)
"If-Match" header.


ifNoneMatch

@Deprecated
public String ifNoneMatch
Deprecated. (scheduled to be made private in 1.6) Use getIfNoneMatch() or setIfNoneMatch(java.lang.String)
"If-None-Match" header.


ifUnmodifiedSince

@Deprecated
public String ifUnmodifiedSince
Deprecated. (scheduled to be made private in 1.6) Use getIfUnmodifiedSince() or setIfUnmodifiedSince(java.lang.String)
"If-Unmodified-Since" header.


lastModified

@Deprecated
public String lastModified
Deprecated. (scheduled to be made private in 1.6) Use getLastModified() or setLastModified(java.lang.String)
"Last-Modified" header.


location

@Deprecated
public String location
Deprecated. (scheduled to be made private in 1.6) Use getLocation() or setLocation(java.lang.String)
"Location" header.


mimeVersion

@Deprecated
public String mimeVersion
Deprecated. (scheduled to be made private in 1.6) Use getMimeVersion() or setMimeVersion(java.lang.String)
"MIME-Version" header.


range

@Deprecated
public String range
Deprecated. (scheduled to be made private in 1.6) Use getRange() or setRange(java.lang.String)
"Range" header.


retryAfter

@Deprecated
public String retryAfter
Deprecated. (scheduled to be made private in 1.6) Use getRetryAfter() or setRetryAfter(java.lang.String)
"Retry-After" header.


userAgent

@Deprecated
public String userAgent
Deprecated. (scheduled to be made private in 1.6) Use getUserAgent() or setUserAgent(java.lang.String)
"User-Agent" header.


authenticate

@Deprecated
public String authenticate
Deprecated. (scheduled to be made private in 1.6) Use getAuthenticate() or setAuthenticate(java.lang.String)
"WWW-Authenticate" header.

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

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 Google. All Rights Reserved.