# Google Data APIs Client Library (1.43.0)

## com.google.gdata.client.youtube
Class YouTubeService

    java.lang.Object
      com.google.gdata.client.Service
          com.google.gdata.client.GoogleService
              com.google.gdata.client.media.MediaService
                  com.google.gdata.client.youtube.YouTubeService

All Implemented Interfaces:
  AuthTokenFactory.TokenListener

    public class YouTubeService

extends MediaService

Java client service for the YouTube GData APIs.

Nested Class Summary
`static class` `YouTubeService.Versions` All released version of the YouTube 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` Version 2 is currently the default version for clients.

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

Method Summary

`

`<E extends IEntry> FormUploadToken`

`

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

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

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_VERSION

    public static final Version DEFAULT_VERSION

  Version 2 is currently the default version for clients.

Constructor Detail

### YouTubeService

    public YouTubeService(java.lang.String applicationName)

  Creates a new instance of the service with the given application name.

  Parameters:
    `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.

### YouTubeService

    public YouTubeService(java.lang.String applicationName,
                          java.lang.String developerId)

  Creates a new instance of the service with the given application name.

  Parameters:
    `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.

### YouTubeService

    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.

  Parameters:
    `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.

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 `Version` of the YouTube GData API.

  Returns:
    version.

### isCompatible

    public static boolean isCompatible(Version version)

  Returns true if the current YouTube GData API version `getVersion()` is compatible with the given version.

  Parameters:
    `version` - version to check compatibility with.
  Returns:
    true if the current version is compatible with the given version, false otherwise.

### getFormUploadToken

    public <E extends IEntry> FormUploadToken getFormUploadToken(java.net.URL url,
                                                                 E entry)
                                       throws ServiceException,
                                              java.io.IOException

  Generate a form-upload token given the XML description of a new media entry.

  Parameters:
    `url` - link with rel=`YouTubeNamespace.GET_UPLOAD_TOKEN_REL` on a user's upload feed
    `entry` - XML metadata of a new media entry
  Throws:
    `ServiceException`
    `java.io.IOException`