Drive API v2 (revision 1)



com.google.api.services.drive
Class Drive

java.lang.Object
  extended by com.google.api.client.http.json.JsonHttpClient
      extended by com.google.api.client.googleapis.services.GoogleClient
          extended by com.google.api.services.drive.Drive

public class Drive
extends GoogleClient

Service definition for Drive (v2).

The API to interact with Drive.

For more information about this service, see the API Documentation

This service uses JsonHttpRequestInitializer to initialize global parameters via its Drive.Builder. Sample usage:

  public class DriveRequestInitializer implements JsonHttpRequestInitializer {
      public void initialize(JsonHttpRequest request) {
        DriveRequest driveRequest = (DriveRequest)request;
        driveRequest.setPrettyPrint(true);
        driveRequest.setKey(ClientCredentials.KEY);
    }
  }
 

Since:
1.3.0
Author:
Google, Inc.

Nested Class Summary
 class Drive.About
          The "about" collection of methods.
 class Drive.Apps
          The "apps" collection of methods.
static class Drive.Builder
          Builder for Drive.
 class Drive.Changes
          The "changes" collection of methods.
 class Drive.Children
          The "children" collection of methods.
 class Drive.Files
          The "files" collection of methods.
 class Drive.Parents
          The "parents" collection of methods.
 class Drive.Permissions
          The "permissions" collection of methods.
 class Drive.Revisions
          The "revisions" collection of methods.
 
Field Summary
static String DEFAULT_BASE_PATH
          Deprecated. (scheduled to be removed in 1.8) Use "/" + DEFAULT_SERVICE_PATH.
static String DEFAULT_BASE_URL
          The default encoded base URL of the service.
static String DEFAULT_ROOT_URL
          The default encoded root URL of the service.
static String DEFAULT_SERVICE_PATH
          The default encoded service path of the service.
 
Constructor Summary
Drive(HttpTransport transport, JsonFactory jsonFactory)
          Deprecated. (scheduled to be removed in 1.8) Use Drive(HttpTransport, JsonFactory, HttpRequestInitializer).
Drive(HttpTransport transport, JsonFactory jsonFactory, HttpRequestInitializer httpRequestInitializer)
          Construct a Drive instance to connect to the Drive service.
 
Method Summary
 Drive.About about()
          An accessor for creating requests from the About collection.
 Drive.Apps apps()
          An accessor for creating requests from the Apps collection.
static Drive.Builder builder(HttpTransport transport, JsonFactory jsonFactory)
          Deprecated. (scheduled to removed in 1.8) Use Builder#Builder(HttpTransport, JsonFactory, HttpRequestInitializer).
 Drive.Changes changes()
          An accessor for creating requests from the Changes collection.
 Drive.Children children()
          An accessor for creating requests from the Children collection.
 Drive.Files files()
          An accessor for creating requests from the Files collection.
protected  void initialize(JsonHttpRequest jsonHttpRequest)
           
 Drive.Parents parents()
          An accessor for creating requests from the Parents collection.
 Drive.Permissions permissions()
          An accessor for creating requests from the Permissions collection.
 Drive.Revisions revisions()
          An accessor for creating requests from the Revisions collection.
 
Methods inherited from class com.google.api.client.googleapis.services.GoogleClient
batch, batch, buildHttpRequest, executeUnparsed, executeUnparsed
 
Methods inherited from class com.google.api.client.http.json.JsonHttpClient
createParser, createSerializer, executeAsInputStream, getApplicationName, getBaseUrl, getJsonFactory, getJsonHttpParser, getJsonHttpRequestInitializer, getJsonObjectParser, getRequestFactory, getRootUrl, getServicePath, isBaseUrlUsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BASE_PATH

@Deprecated
public static final String DEFAULT_BASE_PATH
Deprecated. (scheduled to be removed in 1.8) Use "/" + DEFAULT_SERVICE_PATH.
The default encoded base path of the service. This is determined when the library is generated and normally should not be changed.

See Also:
Constant Field Values

DEFAULT_ROOT_URL

public static final String DEFAULT_ROOT_URL
The default encoded root URL of the service. This is determined when the library is generated and normally should not be changed.

Since:
1.7
See Also:
Constant Field Values

DEFAULT_SERVICE_PATH

public static final String DEFAULT_SERVICE_PATH
The default encoded service path of the service. This is determined when the library is generated and normally should not be changed.

Since:
1.7
See Also:
Constant Field Values

DEFAULT_BASE_URL

public static final String DEFAULT_BASE_URL
The default encoded base URL of the service. This is determined when the library is generated and normally should not be changed.

See Also:
Constant Field Values
Constructor Detail

Drive

@Deprecated
public Drive(HttpTransport transport,
                        JsonFactory jsonFactory)
Deprecated. (scheduled to be removed in 1.8) Use Drive(HttpTransport, JsonFactory, HttpRequestInitializer).

Construct a Drive instance to connect to the Drive service.

Use Drive.Builder if you need to specify any of the optional parameters.

Parameters:
transport - The transport to use for requests
jsonFactory - A factory for creating JSON parsers and serializers

Drive

public Drive(HttpTransport transport,
             JsonFactory jsonFactory,
             HttpRequestInitializer httpRequestInitializer)
Construct a Drive instance to connect to the Drive service.

Use Drive.Builder if you need to specify any of the optional parameters.

Parameters:
transport - The transport to use for requests
jsonFactory - A factory for creating JSON parsers and serializers
httpRequestInitializer - The HTTP request initializer or null for none
Since:
1.7
Method Detail

initialize

protected void initialize(JsonHttpRequest jsonHttpRequest)
                   throws IOException
Overrides:
initialize in class JsonHttpClient
Throws:
IOException

builder

@Deprecated
public static Drive.Builder builder(HttpTransport transport,
                                               JsonFactory jsonFactory)
Deprecated. (scheduled to removed in 1.8) Use Builder#Builder(HttpTransport, JsonFactory, HttpRequestInitializer).

Returns an instance of a new builder.

Parameters:
transport - The transport to use for requests
jsonFactory - A factory for creating JSON parsers and serializers

files

public Drive.Files files()
An accessor for creating requests from the Files collection. The typical use is:
   Drive drive = new Drive(...);
   Drive.Files.List request = drive.files().list(parameters ...)

Returns:
the resource collection

about

public Drive.About about()
An accessor for creating requests from the About collection. The typical use is:
   Drive drive = new Drive(...);
   Drive.About.List request = drive.about().list(parameters ...)

Returns:
the resource collection

apps

public Drive.Apps apps()
An accessor for creating requests from the Apps collection. The typical use is:
   Drive drive = new Drive(...);
   Drive.Apps.List request = drive.apps().list(parameters ...)

Returns:
the resource collection

parents

public Drive.Parents parents()
An accessor for creating requests from the Parents collection. The typical use is:
   Drive drive = new Drive(...);
   Drive.Parents.List request = drive.parents().list(parameters ...)

Returns:
the resource collection

revisions

public Drive.Revisions revisions()
An accessor for creating requests from the Revisions collection. The typical use is:
   Drive drive = new Drive(...);
   Drive.Revisions.List request = drive.revisions().list(parameters ...)

Returns:
the resource collection

changes

public Drive.Changes changes()
An accessor for creating requests from the Changes collection. The typical use is:
   Drive drive = new Drive(...);
   Drive.Changes.List request = drive.changes().list(parameters ...)

Returns:
the resource collection

children

public Drive.Children children()
An accessor for creating requests from the Children collection. The typical use is:
   Drive drive = new Drive(...);
   Drive.Children.List request = drive.children().list(parameters ...)

Returns:
the resource collection

permissions

public Drive.Permissions permissions()
An accessor for creating requests from the Permissions collection. The typical use is:
   Drive drive = new Drive(...);
   Drive.Permissions.List request = drive.permissions().list(parameters ...)

Returns:
the resource collection