Drive API v2 (revision 47)



com.google.api.services.drive
Class Drive.Files

java.lang.Object
  extended by com.google.api.services.drive.Drive.Files
Enclosing class:
Drive

public class Drive.Files
extends java.lang.Object

The "files" collection of methods.


Nested Class Summary
 class Drive.Files.Copy
           
 class Drive.Files.Delete
           
 class Drive.Files.Get
           
 class Drive.Files.Insert
           
 class Drive.Files.List
           
 class Drive.Files.Patch
           
 class Drive.Files.Touch
           
 class Drive.Files.Trash
           
 class Drive.Files.Untrash
           
 class Drive.Files.Update
           
 
Constructor Summary
Drive.Files()
           
 
Method Summary
 Drive.Files.Copy copy(java.lang.String fileId, File content)
          Creates a copy of the specified file.
 Drive.Files.Delete delete(java.lang.String fileId)
          Permanently deletes a file by ID.
 Drive.Files.Get get(java.lang.String fileId)
          Gets a file's metadata by ID.
 Drive.Files.Insert insert(File content)
          Insert a new file.
 Drive.Files.Insert insert(File content, AbstractInputStreamContent mediaContent)
          Insert a new file.
 Drive.Files.List list()
          Lists the user's files.
 Drive.Files.Patch patch(java.lang.String fileId, File content)
          Updates file metadata and/or content.
 Drive.Files.Touch touch(java.lang.String fileId)
          Set the file's updated time to the current server time.
 Drive.Files.Trash trash(java.lang.String fileId)
          Moves a file to the trash.
 Drive.Files.Untrash untrash(java.lang.String fileId)
          Restores a file from the trash.
 Drive.Files.Update update(java.lang.String fileId, File content)
          Updates file metadata and/or content Create a request for the method "files.update".
 Drive.Files.Update update(java.lang.String fileId, File content, AbstractInputStreamContent mediaContent)
          Updates file metadata and/or content Create a request for the method "files.update".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Drive.Files

public Drive.Files()
Method Detail

copy

public Drive.Files.Copy copy(java.lang.String fileId,
                             File content)
                      throws java.io.IOException
Creates a copy of the specified file. Create a request for the method "files.copy". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

Parameters:
fileId - The ID of the file to copy.
content - the File
Returns:
the request
Throws:
java.io.IOException

delete

public Drive.Files.Delete delete(java.lang.String fileId)
                          throws java.io.IOException
Permanently deletes a file by ID. Skips the trash. Create a request for the method "files.delete". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

Parameters:
fileId - The ID of the file to delete.
Returns:
the request
Throws:
java.io.IOException

get

public Drive.Files.Get get(java.lang.String fileId)
                    throws java.io.IOException
Gets a file's metadata by ID. Create a request for the method "files.get". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

Parameters:
fileId - The ID for the file in question.
Returns:
the request
Throws:
java.io.IOException

insert

public Drive.Files.Insert insert(File content)
                          throws java.io.IOException
Insert a new file. Create a request for the method "files.insert". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

Parameters:
content - the File
Returns:
the request
Throws:
java.io.IOException

insert

public Drive.Files.Insert insert(File content,
                                 AbstractInputStreamContent mediaContent)
                          throws java.io.IOException
Insert a new file. Create a request for the method "files.insert". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

This method should be used for uploading media content.

Parameters:
content - the File media metadata or null if none
mediaContent - The media HTTP content or null if none.
Returns:
the request
Throws:
java.io.IOException - if the initialization of the request fails

list

public Drive.Files.List list()
                      throws java.io.IOException
Lists the user's files. Create a request for the method "files.list". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

Returns:
the request
Throws:
java.io.IOException

patch

public Drive.Files.Patch patch(java.lang.String fileId,
                               File content)
                        throws java.io.IOException
Updates file metadata and/or content. This method supports patch semantics. Create a request for the method "files.patch". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

Parameters:
fileId - The ID of the file to update.
content - the File
Returns:
the request
Throws:
java.io.IOException

touch

public Drive.Files.Touch touch(java.lang.String fileId)
                        throws java.io.IOException
Set the file's updated time to the current server time. Create a request for the method "files.touch". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

Parameters:
fileId - The ID of the file to update.
Returns:
the request
Throws:
java.io.IOException

trash

public Drive.Files.Trash trash(java.lang.String fileId)
                        throws java.io.IOException
Moves a file to the trash. Create a request for the method "files.trash". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

Parameters:
fileId - The ID of the file to trash.
Returns:
the request
Throws:
java.io.IOException

untrash

public Drive.Files.Untrash untrash(java.lang.String fileId)
                            throws java.io.IOException
Restores a file from the trash. Create a request for the method "files.untrash". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

Parameters:
fileId - The ID of the file to untrash.
Returns:
the request
Throws:
java.io.IOException

update

public Drive.Files.Update update(java.lang.String fileId,
                                 File content)
                          throws java.io.IOException
Updates file metadata and/or content Create a request for the method "files.update". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

Parameters:
fileId - The ID of the file to update.
content - the File
Returns:
the request
Throws:
java.io.IOException

update

public Drive.Files.Update update(java.lang.String fileId,
                                 File content,
                                 AbstractInputStreamContent mediaContent)
                          throws java.io.IOException
Updates file metadata and/or content Create a request for the method "files.update". This request holds the parameters needed by the the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

This method should be used for uploading media content.

Parameters:
fileId - The ID of the file to update.
content - the File media metadata or null if none
mediaContent - The media HTTP content or null if none.
Returns:
the request
Throws:
java.io.IOException - if the initialization of the request fails