public class DocsService extends MediaService
MediaService
abstraction to define a service that
is preconfigured for access to the Google Documents List Data API.Modifier and Type | Class and Description |
---|---|
static class |
DocsService.Versions
GData versions supported by the Google Documents List Data API.
|
GoogleService.AccountDeletedException, GoogleService.AccountDisabledException, GoogleService.CaptchaRequiredException, GoogleService.InvalidCredentialsException, GoogleService.NotVerifiedException, GoogleService.ServiceUnavailableException, GoogleService.SessionExpiredException, GoogleService.TermsNotAgreedException
Service.ClientInputProperties, Service.ClientOutputProperties, Service.ClientStreamProperties, Service.GDataRequest, Service.GDataRequestFactory
Modifier and Type | Field and Description |
---|---|
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.
|
DEFAULT_CHUNKED_BUFFER_SIZE, NO_CHUNKED_MEDIA_REQUEST
connectTimeout, extProfile, metadataRegistry, requestFactory
Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
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. |
getDefaultAltRegistry, getMedia, getMedia, insert, insert, setChunkedMediaUpload, update, updateMedia, updateMedia
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
classOf, createBatchRequest, createDeleteRequest, createEntryRequest, createFeedRequest, createFeedRequest, createInsertRequest, createLinkQueryRequest, createPatchRequest, createUpdateRequest, delete, delete, endVersionScope, getAltRegistry, getContentType, getEntry, getExtensionProfile, getFeed, getFeed, getMetadataRegistry, getProtocolVersion, getRequestFactory, getSchema, getStreamFromLink, getStrictValidation, initServiceVersion, introspect, parseResponseData, parseResponseData, patch, patch, query, query, query, setAcceptLanguage, setAltRegistry, setConnectTimeout, setContentType, setExtensionProfile, setHeader, setOAuthProxyHeaders, setPrivateHeader, setProtocolVersion, setReadTimeout, setRequestFactory, setStrictValidation, setTimeouts, startVersionScope, update, useSsl, writeRequestData, writeRequestData
public static final java.lang.String DOCS_SERVICE
public static final java.lang.String DOCS_SERVICE_VERSION
public static final Version DEFAULT_VERSION
public DocsService(java.lang.String applicationName)
applicationName
.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(java.lang.String applicationName, Service.GDataRequestFactory requestFactory, AuthTokenFactory authTokenFactory)
applicationName
and the given GDataRequestFactory
and AuthTokenFactory
. Use this constructor to
override the default factories.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
objectsauthTokenFactory
- the factory that creates auth tokenspublic DocsService(java.lang.String applicationName, java.lang.String protocol, java.lang.String domainName)
serviceName
for an application with the name applicationName
. The service will authenticate at the provided domainName
.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 handlerpublic java.lang.String getServiceVersion()
Service
getServiceVersion
in class Service
public static Version getVersion()
public void addExtensions()
public AclEntry insert(java.net.URL aclFeedUrl, AclScope scope, AclRole role) throws java.io.IOException, ServiceException
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.
aclFeedUrl
- the POST URL associated with the target acl feedscope
- the scope of the new aclrole
- the desired role for scopejava.io.IOException
- an ill-formed URI, internal error. See
makeEntryUrlServiceException
- insert request failed due to lack of
permissions, scope already defined on this feed, unsupported role or scope,
system error, etcpublic AclEntry update(java.net.URL aclFeedUrl, AclScope scope, AclRole role) throws java.io.IOException, ServiceException
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.
aclFeedUrl
- the POST URL associated with the target acl feedscope
- the scope of the to-be-updated aclrole
- the desired role for scopejava.io.IOException
- an ill-formed URI, internal error. See
makeEntryUrlServiceException
- update request failed due to lack of
permissions, unsupported role or scope, system error, etcpublic void delete(java.net.URL aclFeedUrl, AclScope scope) throws java.io.IOException, ServiceException
This is a convenience method. It constructs the entry edit URL from the feed URL and scope.
aclFeedUrl
- the POST URI associated with the target acl feedscope
- the scope of the to-be-deleted acljava.io.IOException
- an ill-formed URI, internal error. See
makeEntryUrlServiceException
- delete request failed due to lack of
permissions, unsupported role or scope, system error, etcpublic DocumentExportEntry insert(java.net.URL exportFeedUrl, java.util.List<QueryParameter> params) throws java.io.IOException, ServiceException
exportFeedUrl
- the POST URL associated with the target export feed.params
- the search criteria.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.