public interface DriveOperations
| Modifier and Type | Method and Description |
|---|---|
FileComment |
addComment(java.lang.String fileId,
FileComment comment)
Adds a comment to a file
|
UserPermission |
addPermission(java.lang.String fileId,
UserPermission permission,
boolean sendNotificationEmails)
Adds a permission to a file
|
CommentReply |
addReply(java.lang.String fileId,
java.lang.String commentId,
CommentReply reply)
Adds a reply to a file comment
|
DriveFile |
createFileMetadata(DriveFile metadata)
Creates an empty file with metadata
|
DriveFile |
createFolder(java.lang.String parentId,
java.lang.String name)
Creates a folder
|
void |
delete(java.lang.String id)
Permanently deletes a file
|
org.springframework.core.io.Resource |
downloadFile(DriveFile file)
Downloads a file from Google Drive.
|
org.springframework.core.io.Resource |
downloadFile(java.lang.String id)
Downloads a file from Google Drive.
|
DriveFileQueryBuilder |
driveFileQuery()
Creates a
DriveFileQueryBuilder |
FileCommentQueryBuilder |
fileCommentQueryBuilder(java.lang.String fileId)
Returns a
FileCommentQueryBuilder for listing the comments of a
file |
DriveAbout |
getAbout()
Get general Google Drive details for the current user
|
DriveApp |
getApp(java.lang.String id)
Returns an application by its ID
|
java.util.List<DriveApp> |
getApps()
Returns the applications authorized by the user to access Google Drive
API
|
FileCommentsPage |
getComments(java.lang.String fileId,
java.lang.String pageToken)
Returns the first default page of comments on a file
|
DriveFile |
getFile(java.lang.String id)
Retrieves a file by its ID
|
DriveFilesPage |
getFiles(java.lang.String parent,
java.lang.String pageToken)
Returns the files and folders under a specified folder
|
java.util.List<UserPermission> |
getPermissions(java.lang.String fileId)
Returns the permissions of a file
|
java.util.List<FileRevision> |
getRevisions(java.lang.String fileId)
Returns the revisions of a file
|
DriveFilesPage |
getRootFiles(java.lang.String pageToken)
Returns files and folders under the root folder
|
DriveFilesPage |
getTrashedFiles(java.lang.String pageToken)
Returns trashed files and folders
|
DriveFile |
hide(java.lang.String id)
Hides a file
|
void |
removeComment(java.lang.String fileId,
java.lang.String commentId)
Removes a comment from a file
|
void |
removePermission(java.lang.String fileId,
java.lang.String permissionId)
Removes a permission from a file
|
void |
removeReply(java.lang.String fileId,
java.lang.String commentId,
java.lang.String replyId)
Removes a reply from a file comment
|
DriveFile |
star(java.lang.String id)
Stars a file
|
DriveFile |
trash(java.lang.String id)
Moves a file to trash
|
DriveFile |
unhide(java.lang.String id)
Unhides a file
|
DriveFile |
unstar(java.lang.String id)
Remove the star from a file
|
DriveFile |
untrash(java.lang.String id)
Restores a file from trash
|
FileComment |
updateComment(java.lang.String fileId,
java.lang.String commentId,
FileComment comment)
Updates a comment to a file
|
CommentReply |
updateReply(java.lang.String fileId,
java.lang.String commentId,
java.lang.String replyId,
CommentReply reply)
Updates a reply to a file comment
|
FileRevision |
updateRevision(java.lang.String fileId,
java.lang.String revisionId,
FileRevision revision)
Updates a file revision
|
UserPermission |
updatesPermission(java.lang.String fileId,
java.lang.String permissionId,
UserPermission permission)
Updates a permission to a file
|
DriveFile |
upload(org.springframework.core.io.Resource resource,
DriveFile metadata,
UploadParameters parameters)
Uploads a file using multipart
|
DriveAbout getAbout()
DriveAbout with details for the current userjava.util.List<DriveApp> getApps()
DriveApp for the current userDriveApp getApp(java.lang.String id)
id - The ID of the applicationDriveApp matching the IDDriveFile getFile(java.lang.String id)
id - the ID to retrieve byDriveFile matching the IDDriveFileQueryBuilder driveFileQuery()
DriveFileQueryBuilderDriveFileQueryBuilderDriveFilesPage getRootFiles(java.lang.String pageToken)
pageToken - Page token or nullDriveFilesPageDriveFilesPage getFiles(java.lang.String parent, java.lang.String pageToken)
parent - folder ID or "root"pageToken - Page token or nullDriveFilesPageDriveFilesPage getTrashedFiles(java.lang.String pageToken)
pageToken - Page token or nullDriveFilesPageDriveFile trash(java.lang.String id)
id - The ID of the file to trashDriveFileDriveFile untrash(java.lang.String id)
DriveFile star(java.lang.String id)
id - The ID of the file to starDriveFileDriveFile unstar(java.lang.String id)
id - The ID of the file to unstarDriveFileDriveFile hide(java.lang.String id)
id - The ID of the file to hideDriveFileDriveFile unhide(java.lang.String id)
id - The ID of the file to unhideDriveFilevoid delete(java.lang.String id)
id - The ID of the file to deleteDriveFile upload(org.springframework.core.io.Resource resource, DriveFile metadata, UploadParameters parameters)
resource - Reference to the file's contentmetadata - The file's metadataparameters - Parameters for uploading and processing the fileDriveFile createFileMetadata(DriveFile metadata)
metadata - The file's propertiesDriveFile representing the created fileDriveFile createFolder(java.lang.String parentId, java.lang.String name)
parentId - The parent folder ID or "root"name - The name of the folder to createDriveFile representing the created folderjava.util.List<UserPermission> getPermissions(java.lang.String fileId)
fileId - The ID of the fileUserPermission for the fileUserPermission addPermission(java.lang.String fileId, UserPermission permission, boolean sendNotificationEmails)
fileId - The file IDpermission - UserPermission with the permission settingssendNotificationEmails - Whether to send notification e-mailsUserPermissionUserPermission updatesPermission(java.lang.String fileId, java.lang.String permissionId, UserPermission permission)
fileId - The file IDpermissionId - the ID of the permissionpermission - UserPermission with new role and additionalRoles
propertiesUserPermissionvoid removePermission(java.lang.String fileId,
java.lang.String permissionId)
fileId - The file IDpermissionId - The ID of the permissionjava.util.List<FileRevision> getRevisions(java.lang.String fileId)
fileId - The ID of the fileFileRevisionFileRevision updateRevision(java.lang.String fileId, java.lang.String revisionId, FileRevision revision)
fileId - The ID of the filerevisionId - The ID of the revisionrevision - FileRevision with new pinned, publishAuto, published
and publishedOutsideDomain propertiesFileRevisionFileCommentQueryBuilder fileCommentQueryBuilder(java.lang.String fileId)
FileCommentQueryBuilder for listing the comments of a
filefileId - The ID of the fileFileCommentQueryBuilder for the fileFileCommentsPage getComments(java.lang.String fileId, java.lang.String pageToken)
fileId - The ID of the filepageToken - Page token or nullFileComment addComment(java.lang.String fileId, FileComment comment)
fileId - The ID of the filecomment - The new commentFileCommentFileComment updateComment(java.lang.String fileId, java.lang.String commentId, FileComment comment)
fileId - The ID of the filecommentId - The ID of the commentcomment - Comment with the new contentFileCommentvoid removeComment(java.lang.String fileId,
java.lang.String commentId)
fileId - The ID of the filecommentId - The ID of the commentCommentReply addReply(java.lang.String fileId, java.lang.String commentId, CommentReply reply)
fileId - The ID of the filecommentId - The ID of the commentreply - The new replyCommentReplyCommentReply updateReply(java.lang.String fileId, java.lang.String commentId, java.lang.String replyId, CommentReply reply)
fileId - The ID of the filecommentId - The ID of the commentreplyId - The ID of the replyreply - Reply with new contentCommentReplyvoid removeReply(java.lang.String fileId,
java.lang.String commentId,
java.lang.String replyId)
fileId - The ID of the filecommentId - The ID of the commentreplyId - The ID of the replyorg.springframework.core.io.Resource downloadFile(java.lang.String id)
id - The file IDorg.springframework.core.io.Resource downloadFile(DriveFile file)
DriveFile.getDownloadUrl(), which may have expired since the file
metadata was fetched.file - The file metadata