com.google.api.client.googleapis
Class GoogleHeaders

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
              extended by com.google.api.client.googleapis.GoogleHeaders
All Implemented Interfaces:
Cloneable, Map<String,Object>

public class GoogleHeaders
extends HttpHeaders

HTTP headers for Google API's.

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 gdataClient
          "X-GData-Client" header.
 String gdataKey
          "X-GData-Key" header, which must be of the form "key=[developerId]".
 String gdataVersion
          "GData-Version" header.
 String googAcl
          "x-goog-acl" header that lets you apply predefined (canned) ACLs to a bucket or object when you upload it or create it.
 String googCopySource
          "x-goog-copy-source" header that specifies the destination bucket and object for a copy operation.
 String googCopySourceIfMatch
          "x-goog-copy-source-if-match" header that specifies the conditions for a copy operation.
 String googCopySourceIfModifiedSince
          "x-goog-copy-source-if-modified-since" header that specifies the conditions for a copy operation.
 String googCopySourceIfNoneMatch
          "x-goog-copy-source-if-none-match" header that specifies the conditions for a copy operation.
 String googCopySourceIfUnmodifiedSince
          "x-goog-copy-source-if-unmodified-since" header that specifies the conditions for a copy operation.
 String googDate
          "x-goog-date" header that specifies a time stamp for authenticated requests.
 String googMetadataDirective
          "x-goog-metadata-directive" header that specifies metadata handling during a copy operation.
 String methodOverride
          "X-HTTP-Method-Override" header.
 String slug
          Escaped "Slug" header value, which must be escaped using SLUG_ESCAPER.
static PercentEscaper SLUG_ESCAPER
          Escaper for the slug header.
 
Constructor Summary
GoogleHeaders()
           
 
Method Summary
static String getGoogleLoginValue(String authToken)
          Returns Google Login "Authorization" header value based on the given authentication token.
 void setApplicationName(String applicationName)
          Sets the "User-Agent" header of the form "[company-id]-[app-name]/[app-version]", for example "Google-Sample/1.0".
 void setDeveloperId(String developerId)
          Sets the gdataKey header using the given developer ID.
 void setGoogleLogin(String authToken)
          Sets the Google Login "Authorization" header for the given authentication token.
 void setSlugFromFileName(String fileName)
          Sets the "Slug" header for the given file name, properly escaping the header value.
 
Methods inherited from class com.google.api.client.http.HttpHeaders
clone, getAccept, getAcceptEncoding, getAuthenticate, getAuthorization, getCacheControl, getContentEncoding, getContentLength, getContentMD5, getContentRange, getContentType, getCookie, getDate, getETag, getExpires, getIfMatch, getIfModifiedSince, getIfNoneMatch, getIfUnmodifiedSince, getLastModified, getLocation, getMimeVersion, getRange, getRetryAfter, getUserAgent, setAccept, setAcceptEncoding, setAuthenticate, setAuthorization, setBasicAuthentication, setCacheControl, setContentEncoding, setContentLength, setContentMD5, setContentRange, setContentType, setCookie, setDate, setETag, setExpires, setIfMatch, setIfModifiedSince, setIfNoneMatch, setIfUnmodifiedSince, setLastModified, setLocation, setMimeVersion, setRange, setRetryAfter, setUserAgent
 
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

SLUG_ESCAPER

public static final PercentEscaper SLUG_ESCAPER
Escaper for the slug header.


gdataVersion

public String gdataVersion
"GData-Version" header.


slug

public String slug
Escaped "Slug" header value, which must be escaped using SLUG_ESCAPER.

See Also:
setSlugFromFileName(String)

gdataClient

public String gdataClient
"X-GData-Client" header.


gdataKey

public String gdataKey
"X-GData-Key" header, which must be of the form "key=[developerId]".

See Also:
setDeveloperId(String)

googAcl

public String googAcl
"x-goog-acl" header that lets you apply predefined (canned) ACLs to a bucket or object when you upload it or create it.


googCopySource

public String googCopySource
"x-goog-copy-source" header that specifies the destination bucket and object for a copy operation.


googCopySourceIfMatch

public String googCopySourceIfMatch
"x-goog-copy-source-if-match" header that specifies the conditions for a copy operation.


googCopySourceIfNoneMatch

public String googCopySourceIfNoneMatch
"x-goog-copy-source-if-none-match" header that specifies the conditions for a copy operation.


googCopySourceIfModifiedSince

public String googCopySourceIfModifiedSince
"x-goog-copy-source-if-modified-since" header that specifies the conditions for a copy operation.


googCopySourceIfUnmodifiedSince

public String googCopySourceIfUnmodifiedSince
"x-goog-copy-source-if-unmodified-since" header that specifies the conditions for a copy operation.


googDate

public String googDate
"x-goog-date" header that specifies a time stamp for authenticated requests.


googMetadataDirective

public String googMetadataDirective
"x-goog-metadata-directive" header that specifies metadata handling during a copy operation.


methodOverride

public String methodOverride
"X-HTTP-Method-Override" header.

Constructor Detail

GoogleHeaders

public GoogleHeaders()
Method Detail

setSlugFromFileName

public void setSlugFromFileName(String fileName)
Sets the "Slug" header for the given file name, properly escaping the header value. See The Slug Header.


setApplicationName

public void setApplicationName(String applicationName)
Sets the "User-Agent" header of the form "[company-id]-[app-name]/[app-version]", for example "Google-Sample/1.0".


setDeveloperId

public void setDeveloperId(String developerId)
Sets the gdataKey header using the given developer ID.


setGoogleLogin

public void setGoogleLogin(String authToken)
Sets the Google Login "Authorization" header for the given authentication token.


getGoogleLoginValue

public static String getGoogleLoginValue(String authToken)
Returns Google Login "Authorization" header value based on the given authentication token.



Copyright © 2010-2011 Google. All Rights Reserved.