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.

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 gdataClient
          Deprecated. (scheduled to be made private in 1.9) Use getGDataClient() or setGDataClient(java.lang.String)
 String gdataKey
          Deprecated. (scheduled to be made private in 1.9) Use getGDataKey() or setGDataKey(java.lang.String)
 String gdataVersion
          Deprecated. (scheduled to be made private in 1.9) Use getGDataVersion() or setGDataVersion(java.lang.String)
 String googAcl
          Deprecated. (scheduled to be removed in 1.9)
 String googCopySource
          Deprecated. (scheduled to be removed in 1.9)
 String googCopySourceIfMatch
          Deprecated. (scheduled to be removed in 1.9)
 String googCopySourceIfModifiedSince
          Deprecated. (scheduled to be removed in 1.9)
 String googCopySourceIfNoneMatch
          Deprecated. (scheduled to be removed in 1.9)
 String googCopySourceIfUnmodifiedSince
          Deprecated. (scheduled to be removed in 1.9)
 String googDate
          Deprecated. (scheduled to be removed in 1.9)
 String googMetadataDirective
          Deprecated. (scheduled to be removed in 1.9)
 String methodOverride
          Deprecated. (scheduled to be made private in 1.9) Use getMethodOverride() or setMethodOverride(java.lang.String)
 String slug
          Deprecated. (scheduled to be made private in 1.9) Use getSlug() or setSlug(java.lang.String)
static PercentEscaper SLUG_ESCAPER
          Escaper for the slug header.
 
Constructor Summary
GoogleHeaders()
           
 
Method Summary
 String getGDataClient()
          Returns the "X-GData-Client" header.
 String getGDataKey()
          Returns the "X-GData-Key" header, which must be of the form "key=[developerId]" .
 String getGDataVersion()
          Returns the "GData-Version" header.
static String getGoogleLoginValue(String authToken)
          Returns Google Login "Authorization" header value based on the given authentication token.
 String getMethodOverride()
          Returns the "X-HTTP-Method-Override" header.
 String getSlug()
          Returns the escaped "Slug" header value, which must be escaped using SLUG_ESCAPER.
 long getUploadContentLength()
          Returns the "X-Upload-Content-Length" header or null for none.
 String getUploadContentType()
          Returns the "X-Upload-Content-Type" header or null for none.
 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 setGDataClient(String gdataClient)
          Sets the "X-GData-Client" header.
 void setGDataKey(String gdataKey)
          Sets the "X-GData-Key" header, which must be of the form "key=[developerId]".
 void setGDataVersion(String gdataVersion)
          Sets the "GData-Version" header.
 void setGoogleLogin(String authToken)
          Sets the Google Login "Authorization" header for the given authentication token.
 void setMethodOverride(String methodOverride)
          Sets the "X-HTTP-Method-Override" header.
 void setSlug(String slug)
          Sets the escaped "Slug" header value, which must be escaped using SLUG_ESCAPER.
 void setSlugFromFileName(String fileName)
          Sets the "Slug" header for the given file name, properly escaping the header value.
 void setUploadContentLength(long uploadContentLength)
          Sets the "X-Upload-Content-Length" header or null for none.
 void setUploadContentType(String uploadContentType)
          Sets the "X-Upload-Content-Type" header or null for none.
 
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

@Deprecated
public String gdataVersion
Deprecated. (scheduled to be made private in 1.9) Use getGDataVersion() or setGDataVersion(java.lang.String)
"GData-Version" header.


slug

@Deprecated
public String slug
Deprecated. (scheduled to be made private in 1.9) Use getSlug() or setSlug(java.lang.String)
Escaped "Slug" header value, which must be escaped using SLUG_ESCAPER.

See Also:
setSlugFromFileName(String)

gdataClient

@Deprecated
public String gdataClient
Deprecated. (scheduled to be made private in 1.9) Use getGDataClient() or setGDataClient(java.lang.String)
"X-GData-Client" header.


gdataKey

@Deprecated
public String gdataKey
Deprecated. (scheduled to be made private in 1.9) Use getGDataKey() or setGDataKey(java.lang.String)
"X-GData-Key" header, which must be of the form "key=[developerId]".

See Also:
setDeveloperId(String)

googAcl

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


googCopySource

@Deprecated
public String googCopySource
Deprecated. (scheduled to be removed in 1.9)
"x-goog-copy-source" header that specifies the destination bucket and object for a copy operation.


googCopySourceIfMatch

@Deprecated
public String googCopySourceIfMatch
Deprecated. (scheduled to be removed in 1.9)
"x-goog-copy-source-if-match" header that specifies the conditions for a copy operation.


googCopySourceIfNoneMatch

@Deprecated
public String googCopySourceIfNoneMatch
Deprecated. (scheduled to be removed in 1.9)
"x-goog-copy-source-if-none-match" header that specifies the conditions for a copy operation.


googCopySourceIfModifiedSince

@Deprecated
public String googCopySourceIfModifiedSince
Deprecated. (scheduled to be removed in 1.9)
"x-goog-copy-source-if-modified-since" header that specifies the conditions for a copy operation.


googCopySourceIfUnmodifiedSince

@Deprecated
public String googCopySourceIfUnmodifiedSince
Deprecated. (scheduled to be removed in 1.9)
"x-goog-copy-source-if-unmodified-since" header that specifies the conditions for a copy operation.


googDate

@Deprecated
public String googDate
Deprecated. (scheduled to be removed in 1.9)
"x-goog-date" header that specifies a time stamp for authenticated requests.


googMetadataDirective

@Deprecated
public String googMetadataDirective
Deprecated. (scheduled to be removed in 1.9)
"x-goog-metadata-directive" header that specifies metadata handling during a copy operation.


methodOverride

@Deprecated
public String methodOverride
Deprecated. (scheduled to be made private in 1.9) Use getMethodOverride() or setMethodOverride(java.lang.String)
"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.


getUploadContentLength

public final long getUploadContentLength()
Returns the "X-Upload-Content-Length" header or null for none.

Since:
1.7

setUploadContentLength

public final void setUploadContentLength(long uploadContentLength)
Sets the "X-Upload-Content-Length" header or null for none.

Since:
1.7

getUploadContentType

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

Since:
1.7

setUploadContentType

public final void setUploadContentType(String uploadContentType)
Sets the "X-Upload-Content-Type" header or null for none.

Since:
1.7

getGoogleLoginValue

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


getGDataVersion

public final String getGDataVersion()
Returns the "GData-Version" header.

Since:
1.8

setGDataVersion

public final void setGDataVersion(String gdataVersion)
Sets the "GData-Version" header.

Since:
1.8

getSlug

public final String getSlug()
Returns the escaped "Slug" header value, which must be escaped using SLUG_ESCAPER.

Since:
1.8

setSlug

public final void setSlug(String slug)
Sets the escaped "Slug" header value, which must be escaped using SLUG_ESCAPER.

Since:
1.8

getGDataClient

public final String getGDataClient()
Returns the "X-GData-Client" header.

Since:
1.8

setGDataClient

public final void setGDataClient(String gdataClient)
Sets the "X-GData-Client" header.

Since:
1.8

getGDataKey

public final String getGDataKey()
Returns the "X-GData-Key" header, which must be of the form "key=[developerId]" .

Since:
1.8

setGDataKey

public final void setGDataKey(String gdataKey)
Sets the "X-GData-Key" header, which must be of the form "key=[developerId]".

Since:
1.8

getMethodOverride

public final String getMethodOverride()
Returns the "X-HTTP-Method-Override" header.

Since:
1.8

setMethodOverride

public final void setMethodOverride(String methodOverride)
Sets the "X-HTTP-Method-Override" header.

Since:
1.8


Copyright © 2010-2012 Google. All Rights Reserved.