public class YouTubeService extends MediaService
| Modifier and Type | Class and Description |
|---|---|
static class |
YouTubeService.Versions
All released version of the YouTube API.
|
GoogleService.AccountDeletedException, GoogleService.AccountDisabledException, GoogleService.CaptchaRequiredException, GoogleService.InvalidCredentialsException, GoogleService.NotVerifiedException, GoogleService.ServiceUnavailableException, GoogleService.SessionExpiredException, GoogleService.TermsNotAgreedExceptionService.ClientInputProperties, Service.ClientOutputProperties, Service.ClientStreamProperties, Service.GDataRequest, Service.GDataRequestFactory| Modifier and Type | Field and Description |
|---|---|
static Version |
DEFAULT_VERSION
Version 2 is currently the default version for clients.
|
DEFAULT_CHUNKED_BUFFER_SIZE, NO_CHUNKED_MEDIA_REQUESTconnectTimeout, extProfile, metadataRegistry, requestFactory| Modifier | Constructor and Description |
|---|---|
|
YouTubeService(java.lang.String applicationName)
Creates a new instance of the service with the given application name.
|
|
YouTubeService(java.lang.String applicationName,
java.lang.String developerId)
Creates a new instance of the service with the given application name.
|
protected |
YouTubeService(java.lang.String applicationName,
java.lang.String developerId,
java.net.URL authBaseUrl)
Creates a new instance of the service with the given application name and a
custom user authentication URL.
|
| Modifier and Type | Method and Description |
|---|---|
<E extends IEntry> |
getFormUploadToken(java.net.URL url,
E entry)
Generate a form-upload token given the XML description of a new media entry.
|
java.lang.String |
getServiceVersion()
Returns information about the service version.
|
static Version |
getVersion()
Returns the current
Version of the YouTube GData API. |
static boolean |
isCompatible(Version version)
Returns true if the current YouTube GData API version
getVersion()
is compatible with the given version. |
getDefaultAltRegistry, getMedia, getMedia, insert, insert, setChunkedMediaUpload, update, updateMedia, updateMediaaddCookie, 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, tokenChangedclassOf, 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, writeRequestDatapublic static final Version DEFAULT_VERSION
public YouTubeService(java.lang.String applicationName)
applicationName - should be a string identifying the application using
the API, usually in this format:
[company-id]-[app-name]-[app-version].
This is also used as the client id.public YouTubeService(java.lang.String applicationName,
java.lang.String developerId)
applicationName - should be a string identifying the application using
the API, usually in this format:
[company-id]-[app-name]-[app-version].
This is also used as the client id.developerId - the developer id to send in every request made through
this client, can be null.protected YouTubeService(java.lang.String applicationName,
java.lang.String developerId,
java.net.URL authBaseUrl)
applicationName - should be a string identifying the application using
the API, usually in this format:
[company-id]-[app-name]-[app-version].
This is also used as the client id.developerId - the developer id to send in every request made through
this client, can be null.authBaseUrl - the base URL pointing to the authentication server.public java.lang.String getServiceVersion()
ServicegetServiceVersion in class Servicepublic static Version getVersion()
Version of the YouTube GData API.public static boolean isCompatible(Version version)
getVersion()
is compatible with the given version.version - version to check compatibility with.public <E extends IEntry> FormUploadToken getFormUploadToken(java.net.URL url, E entry) throws ServiceException, java.io.IOException
url - link with rel=YouTubeNamespace.GET_UPLOAD_TOKEN_REL on a user's
upload feedentry - XML metadata of a new media entryServiceExceptionjava.io.IOException