All Downloads are FREE. Search and download functionalities are using the official Maven repository.

target.apidocs.com.google.api.services.drive.Drive.Files.html Maven / Gradle / Ivy







Drive.Files (Drive API v2-rev20180830-1.26.0)












com.google.api.services.drive

Class Drive.Files

  • Enclosing class:
    Drive


    public class Drive.Files
    extends Object
    The "files" collection of methods.
    • Constructor Detail

      • Files

        public Files()
    • Method Detail

      • copy

        public Drive.Files.Copy copy(String fileId,
                                     File content)
                              throws IOException
        Creates a copy of the specified file. Create a request for the method "files.copy". This request holds the parameters needed by 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:
        IOException
      • delete

        public Drive.Files.Delete delete(String fileId)
                                  throws IOException
        Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files. Create a request for the method "files.delete". This request holds the parameters needed by 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:
        IOException
      • emptyTrash

        public Drive.Files.EmptyTrash emptyTrash()
                                          throws IOException
        Permanently deletes all of the user's trashed files. Create a request for the method "files.emptyTrash". This request holds the parameters needed by the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Returns:
        the request
        Throws:
        IOException
      • export

        public Drive.Files.Export export(String fileId,
                                         String mimeType)
                                  throws IOException
        Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. Create a request for the method "files.export". This request holds the parameters needed by 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.
        mimeType - The MIME type of the format requested for this export.
        Returns:
        the request
        Throws:
        IOException
      • generateIds

        public Drive.Files.GenerateIds generateIds()
                                            throws IOException
        Generates a set of file IDs which can be provided in insert requests. Create a request for the method "files.generateIds". This request holds the parameters needed by the drive server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Returns:
        the request
        Throws:
        IOException
      • get

        public Drive.Files.Get get(String fileId)
                            throws IOException
        Gets a file's metadata by ID. Create a request for the method "files.get". This request holds the parameters needed by 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:
        IOException
      • insert

        public Drive.Files.Insert insert(File content)
                                  throws IOException
        Insert a new file. Create a request for the method "files.insert". This request holds the parameters needed by 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:
        IOException
      • insert

        public Drive.Files.Insert insert(File content,
                                         com.google.api.client.http.AbstractInputStreamContent mediaContent)
                                  throws 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:
        IOException - if the initialization of the request fails
      • list

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

        public Drive.Files.Patch patch(String fileId,
                                       File content)
                                throws 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 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:
        IOException
      • touch

        public Drive.Files.Touch touch(String fileId)
                                throws 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 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:
        IOException
      • trash

        public Drive.Files.Trash trash(String fileId)
                                throws IOException
        Moves a file to the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for Team Drive files. Create a request for the method "files.trash". This request holds the parameters needed by 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:
        IOException
      • untrash

        public Drive.Files.Untrash untrash(String fileId)
                                    throws IOException
        Restores a file from the trash. Create a request for the method "files.untrash". This request holds the parameters needed by 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:
        IOException
      • update

        public Drive.Files.Update update(String fileId,
                                         File content)
                                  throws IOException
        Updates file metadata and/or content. Create a request for the method "files.update". This request holds the parameters needed by 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:
        IOException
      • update

        public Drive.Files.Update update(String fileId,
                                         File content,
                                         com.google.api.client.http.AbstractInputStreamContent mediaContent)
                                  throws 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:
        IOException - if the initialization of the request fails
      • watch

        public Drive.Files.Watch watch(String fileId,
                                       Channel content)
                                throws IOException
        Subscribe to changes on a file Create a request for the method "files.watch". This request holds the parameters needed by 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.
        content - the Channel
        Returns:
        the request
        Throws:
        IOException

Copyright © 2011–2018 Google. All rights reserved.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy