public class

YouTubeService

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

Class Overview

Java client service for the YouTube GData APIs.

Summary

Nested Classes
class YouTubeService.Versions All released version of the YouTube API. 
Constants
String SERVICE_NAME
String SERVICE_VERSION
[Expand]
Inherited Constants
From class com.google.gdata.client.media.MediaService
Fields
private static final URL DEFAULT_AUTH_URL
public static final Version DEFAULT_VERSION Version 2 is currently the default version for clients.
[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
YouTubeService(String applicationName)
Creates a new instance of the service with the given application name.
YouTubeService(String applicationName, String developerId)
Creates a new instance of the service with the given application name.
Protected Constructors
YouTubeService(String applicationName, String developerId, URL authBaseUrl)
Creates a new instance of the service with the given application name and a custom user authentication URL.
Public Methods
<E extends IEntry> FormUploadToken getFormUploadToken(URL url, E entry)
Generate a form-upload token given the XML description of a new media entry.
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.
[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

private static final String SERVICE_NAME

Constant Value: "youtube"

private static final String SERVICE_VERSION

Constant Value: "YouTube-Java/1.0"

Fields

private static final URL DEFAULT_AUTH_URL

public static final Version DEFAULT_VERSION

Version 2 is currently the default version for clients.

Public Constructors

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

public YouTubeService (String applicationName, 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.

Protected Constructors

protected YouTubeService (String applicationName, String developerId, 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.

Public Methods

public FormUploadToken getFormUploadToken (URL url, E entry)

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

Parameters
url Link with rel=GET_UPLOAD_TOKEN_REL on a user's upload feed
entry XML metadata of a new media entry
Throws
IOException
ServiceException

public String getServiceVersion ()

Returns information about the service version.

public static Version getVersion ()

Returns the current Version of the YouTube GData API.

Returns
  • version.

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.