Google Data APIs Client Library (1.41.1)



com.google.gdata.client.docs
Class DocsService

java.lang.Object
  extended by com.google.gdata.client.Service
      extended by com.google.gdata.client.GoogleService
          extended by com.google.gdata.client.media.MediaService
              extended by com.google.gdata.client.docs.DocsService
All Implemented Interfaces:
AuthTokenFactory.TokenListener

public class DocsService
extends MediaService

Extends the basic MediaService abstraction to define a service that is preconfigured for access to the Google Documents List Data API.


Nested Class Summary
static class DocsService.Versions
          GData versions supported by the Google Documents List Data API.
 
Nested classes/interfaces inherited from class com.google.gdata.client.GoogleService
GoogleService.AccountDeletedException, GoogleService.AccountDisabledException, GoogleService.CaptchaRequiredException, GoogleService.InvalidCredentialsException, GoogleService.NotVerifiedException, GoogleService.ServiceUnavailableException, GoogleService.SessionExpiredException, GoogleService.TermsNotAgreedException
 
Nested classes/interfaces inherited from class com.google.gdata.client.Service
Service.ClientInputProperties, Service.ClientOutputProperties, Service.ClientStreamProperties, Service.GDataRequest, Service.GDataRequestFactory
 
Field Summary
static Version DEFAULT_VERSION
          Default GData version used by the Google Documents List Data API.
static java.lang.String DOCS_SERVICE
          The abbreviated name of Google Documents List Data API recognized by Google.
static java.lang.String DOCS_SERVICE_VERSION
          The version ID of the service.
 
Fields inherited from class com.google.gdata.client.media.MediaService
DEFAULT_CHUNKED_BUFFER_SIZE, NO_CHUNKED_MEDIA_REQUEST
 
Fields inherited from class com.google.gdata.client.Service
connectTimeout, extProfile, metadataRegistry, requestFactory
 
Constructor Summary
DocsService(java.lang.String applicationName)
          Constructs an instance connecting to the Google Documents List Data API for an application with the name applicationName.
DocsService(java.lang.String applicationName, Service.GDataRequestFactory requestFactory, AuthTokenFactory authTokenFactory)
          Constructs an instance connecting to the Google Documents List Data API for an application with the name applicationName and the given GDataRequestFactory and AuthTokenFactory.
DocsService(java.lang.String applicationName, java.lang.String protocol, java.lang.String domainName)
          Constructs an instance connecting to the Google Documents List Data API with name serviceName for an application with the name applicationName.
 
Method Summary
 void addExtensions()
          Adds the Google Docs extensions.
 void delete(java.net.URL aclFeedUrl, AclScope scope)
          Deletes an existing AclEntry from the specified feed URL.
 java.lang.String getServiceVersion()
          Returns information about the service version.
static Version getVersion()
          Returns the current GData version used by the Google Documents List Data API.
 AclEntry insert(java.net.URL aclFeedUrl, AclScope scope, AclRole role)
          Inserts a new AclEntry into a feed associated with the target service.
 DocumentExportEntry insert(java.net.URL exportFeedUrl, java.util.List<QueryParameter> params)
          Start a new request to download the documents that match all search criteria as a zip file.
 AclEntry update(java.net.URL aclFeedUrl, AclScope scope, AclRole role)
          Updates an existing AclEntry by writing it to the specified feed URL.
 
Methods inherited from class com.google.gdata.client.media.MediaService
getDefaultAltRegistry, getMedia, getMedia, insert, insert, setChunkedMediaUpload, update, updateMedia, updateMedia
 
Methods inherited from class com.google.gdata.client.GoogleService
addCookie, batch, createRequest, createRequest, delete, delete, getAuthToken, getAuthTokenFactory, getCookieManager, getCookies, getEntry, getEntry, getFeed, getFeed, getFeed, getFeed, handleRedirectException, handlesCookies, handleSessionExpiredException, makePostRequest, setAuthSubToken, setAuthSubToken, setAuthTokenFactory, setCookieManager, setHandlesCookies, setOAuthCredentials, setUserCredentials, setUserCredentials, setUserCredentials, setUserCredentials, setUserToken, tokenChanged
 
Methods inherited from class com.google.gdata.client.Service
classOf, createBatchRequest, createDeleteRequest, createEntryRequest, createFeedRequest, createFeedRequest, createInsertRequest, createLinkQueryRequest, createPatchRequest, createUpdateRequest, delete, delete, endVersionScope, getAltRegistry, getContentType, getEntry, getExtensionProfile, getFeed, getFeed, getMetadataRegistry, getProtocolVersion, getRequestFactory, getSchema, getStreamFromLink, initServiceVersion, introspect, parseResponseData, parseResponseData, patch, patch, query, query, query, setAcceptLanguage, setAltRegistry, setConnectTimeout, setContentType, setExtensionProfile, setHeader, setOAuthProxyHeaders, setPrivateHeader, setProtocolVersion, setReadTimeout, setRequestFactory, setTimeouts, startVersionScope, update, useSsl, writeRequestData, writeRequestData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCS_SERVICE

public static final java.lang.String DOCS_SERVICE
The abbreviated name of Google Documents List Data API recognized by Google. The service name is used when requesting an authentication token.

See Also:
Constant Field Values

DOCS_SERVICE_VERSION

public static final java.lang.String DOCS_SERVICE_VERSION
The version ID of the service.


DEFAULT_VERSION

public static final Version DEFAULT_VERSION
Default GData version used by the Google Documents List Data API.

Constructor Detail

DocsService

public DocsService(java.lang.String applicationName)
Constructs an instance connecting to the Google Documents List Data API for an application with the name applicationName.

Parameters:
applicationName - the name of the client application accessing the service. Application names should preferably have the format [company-id]-[app-name]-[app-version]. The name will be used by the Google servers to monitor the source of authentication.

DocsService

public DocsService(java.lang.String applicationName,
                   Service.GDataRequestFactory requestFactory,
                   AuthTokenFactory authTokenFactory)
Constructs an instance connecting to the Google Documents List Data API for an application with the name applicationName and the given GDataRequestFactory and AuthTokenFactory. Use this constructor to override the default factories.

Parameters:
applicationName - the name of the client application accessing the service. Application names should preferably have the format [company-id]-[app-name]-[app-version]. The name will be used by the Google servers to monitor the source of authentication.
requestFactory - the request factory that generates gdata request objects
authTokenFactory - the factory that creates auth tokens

DocsService

public DocsService(java.lang.String applicationName,
                   java.lang.String protocol,
                   java.lang.String domainName)
Constructs an instance connecting to the Google Documents List Data API with name serviceName for an application with the name applicationName. The service will authenticate at the provided domainName.

Parameters:
applicationName - the name of the client application accessing the service. Application names should preferably have the format [company-id]-[app-name]-[app-version]. The name will be used by the Google servers to monitor the source of authentication.
protocol - name of protocol to use for authentication ("http"/"https")
domainName - the name of the domain hosting the login handler
Method Detail

getServiceVersion

public java.lang.String getServiceVersion()
Description copied from class: Service
Returns information about the service version.

Overrides:
getServiceVersion in class Service

getVersion

public static Version getVersion()
Returns the current GData version used by the Google Documents List Data API.


addExtensions

public void addExtensions()
Adds the Google Docs extensions.


insert

public AclEntry insert(java.net.URL aclFeedUrl,
                       AclScope scope,
                       AclRole role)
                throws java.io.IOException,
                       ServiceException
Inserts a new AclEntry into a feed associated with the target service. It will return the inserted AclEntry, including any additional attributes or extensions set by the GData server.

This is a convenience method. It constructs the AclEntry from the specified AclScope and AclRole.

Parameters:
aclFeedUrl - the POST URL associated with the target acl feed
scope - the scope of the new acl
role - the desired role for scope
Returns:
the newly inserted AclEntry returned by the service
Throws:
java.io.IOException - an ill-formed URI, internal error. See makeEntryUrl
ServiceException - insert request failed due to lack of permissions, scope already defined on this feed, unsupported role or scope, system error, etc

update

public AclEntry update(java.net.URL aclFeedUrl,
                       AclScope scope,
                       AclRole role)
                throws java.io.IOException,
                       ServiceException
Updates an existing AclEntry by writing it to the specified feed URL. The resulting AclEntry (after update) will be returned.

This is a convenience method. It constructs the entry edit URL from the feed URL and scope, and also constructs the AclEntry.

Parameters:
aclFeedUrl - the POST URL associated with the target acl feed
scope - the scope of the to-be-updated acl
role - the desired role for scope
Returns:
the updated entry returned by the service
Throws:
java.io.IOException - an ill-formed URI, internal error. See makeEntryUrl
ServiceException - update request failed due to lack of permissions, unsupported role or scope, system error, etc

delete

public void delete(java.net.URL aclFeedUrl,
                   AclScope scope)
            throws java.io.IOException,
                   ServiceException
Deletes an existing AclEntry from the specified feed URL. specified edit URL.

This is a convenience method. It constructs the entry edit URL from the feed URL and scope.

Parameters:
aclFeedUrl - the POST URI associated with the target acl feed
scope - the scope of the to-be-deleted acl
Throws:
java.io.IOException - an ill-formed URI, internal error. See makeEntryUrl
ServiceException - delete request failed due to lack of permissions, unsupported role or scope, system error, etc

insert

public DocumentExportEntry insert(java.net.URL exportFeedUrl,
                                  java.util.List<QueryParameter> params)
                           throws java.io.IOException,
                                  ServiceException
Start a new request to download the documents that match all search criteria as a zip file.

Parameters:
exportFeedUrl - the POST URL associated with the target export feed.
params - the search criteria.
Returns:
the newly inserted DocumentExportEntry returned by the service.
Throws:
java.io.IOException - an ill-formed URI, internal error.
ServiceException - insert request failed due to lack of permissions, scope already defined on this feed, unsupported role or scope, system error, etc.