public class

DocsService

extends MediaService
java.lang.Object
   ↳ com.google.gdata.client.Service
     ↳ com.google.gdata.client.GoogleService
       ↳ com.google.gdata.client.media.MediaService
         ↳ com.google.gdata.client.docs.DocsService

Class Overview

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

Summary

Nested Classes
class DocsService.Versions GData versions supported by the Google Documents List Data API. 
Constants
String DOCS_SERVICE The abbreviated name of Google Documents List Data API recognized by Google.
[Expand]
Inherited Constants
From class com.google.gdata.client.media.MediaService
Fields
public static final Version DEFAULT_VERSION Default GData version used by the Google Documents List Data API.
public static final String DOCS_SERVICE_VERSION The version ID of the service.
[Expand]
Inherited Fields
From class com.google.gdata.client.media.MediaService
From class com.google.gdata.client.GoogleService
From class com.google.gdata.client.Service
Public Constructors
DocsService(String applicationName)
Constructs an instance connecting to the Google Documents List Data API for an application with the name applicationName.
DocsService(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(String applicationName, String protocol, String domainName)
Constructs an instance connecting to the Google Documents List Data API with name serviceName for an application with the name applicationName.
Public Methods
void addExtensions()
Adds the Google Docs extensions.
void delete(URL aclFeedUrl, AclScope scope)
Deletes an existing AclEntry from the specified feed URL.
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(URL aclFeedUrl, AclScope scope, AclRole role)
Inserts a new AclEntry into a feed associated with the target service.
DocumentExportEntry insert(URL exportFeedUrl, List<QueryParameter> params)
Start a new request to download the documents that match all search criteria as a zip file.
AclEntry update(URL aclFeedUrl, AclScope scope, AclRole role)
Updates an existing AclEntry by writing it to the specified feed URL.
[Expand]
Inherited Methods
From class com.google.gdata.client.media.MediaService
From class com.google.gdata.client.GoogleService
From class com.google.gdata.client.Service
From class java.lang.Object
From interface com.google.gdata.client.AuthTokenFactory.TokenListener

Constants

public static final 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.

Constant Value: "writely"

Fields

public static final Version DEFAULT_VERSION

Default GData version used by the Google Documents List Data API.

public static final String DOCS_SERVICE_VERSION

The version ID of the service.

Public Constructors

public DocsService (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.

public DocsService (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

public DocsService (String applicationName, String protocol, 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

Public Methods

public void addExtensions ()

Adds the Google Docs extensions.

public void delete (URL aclFeedUrl, AclScope scope)

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
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

public String getServiceVersion ()

Returns information about the service version.

public static Version getVersion ()

Returns the current GData version used by the Google Documents List Data API.

public AclEntry insert (URL aclFeedUrl, AclScope scope, AclRole role)

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
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

public DocumentExportEntry insert (URL exportFeedUrl, List<QueryParameter> params)

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
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.

public AclEntry update (URL aclFeedUrl, AclScope scope, AclRole role)

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
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