com.google.android.gms.drive.DriveFile |
A file in Drive. This class provides access to the contents and metadata of the specified file.
To retrieve a DriveFile from a known drive id, use
getFile(GoogleApiClient, DriveId)
.
Nested Classes | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DriveFile.DownloadProgressListener | A listener that listens for progress events on an active contents download. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | MODE_READ_ONLY | A mode that opens the contents only for reading. | |||||||||
int | MODE_READ_WRITE | A mode that opens the contents only for writing. | |||||||||
int | MODE_WRITE_ONLY | A mode that opens the contents for reading and writing. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Closes the previously opened contents, updates the Metadata associated with this file, and
commits any changes if the contents were open for write.
| |||||||||||
Closes the previously opened contents, and commits any changes if the contents were open
for write.
| |||||||||||
Closes the provided contents without saving the results.
| |||||||||||
Opens the contents that are associated with this file for read and/or write.
|
[Expand]
Inherited Methods | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]()
|
A mode that opens the contents only for reading.
A mode that opens the contents only for writing.
A mode that opens the contents for reading and writing.
Closes the previously opened contents, updates the Metadata associated with this file, and
commits any changes if the contents were open for write. After invoking this method, the
contents are no longer valid. New contents should not be closed via this method. Instead,
use them to create a new file via
createFile(GoogleApiClient, MetadataChangeSet, Contents)
or
newCreateFileActivityBuilder()
.
apiClient | The GoogleApiClient to service the call. The client must be
connected before invoking this method. |
---|---|
contents | The contents that will be saved and closed. |
changeSet | The set of changes that will be applied to the Metadata. Only include the specific fields that should be updated. |
Closes the previously opened contents, and commits any changes if the contents were open
for write. After invoking this method, the contents are no longer valid. New contents
should not be closed via this method. Instead, use them to create a new file via
createFile(GoogleApiClient, MetadataChangeSet, Contents)
or
newCreateFileActivityBuilder()
.
apiClient | The GoogleApiClient to service the call. The client must be
connected before invoking this method. |
---|---|
contents | The contents that will be saved and closed. |
Closes the provided contents without saving the results.
apiClient | The GoogleApiClient to service the call. The client must be
connected before invoking this method. |
---|---|
contents | The contents to discard. |
Opens the contents that are associated with this file for read and/or write. The returned
file is a temporary copy available only to this app. The contents are returned when they are
available on the device in their entirety. To listen for progress, provide a
DriveFile.DownloadProgressListener
.
The contents must be closed via commitAndCloseContents(GoogleApiClient, Contents)
. If the contents are
opened for write, invoking close will save the updates. Every open must be matched with a
corresponding commitAndCloseContents(GoogleApiClient, Contents)
.
Note: to open the file in edit mode, the user must have edit access. See
isEditable()
.
apiClient | The GoogleApiClient to service the call. |
---|---|
mode | Describes the mode in which to open the file. Possible values are
MODE_READ_ONLY , MODE_READ_WRITE and MODE_WRITE_ONLY . |
listener | An optional listener that will announce progress as the file is downloaded.
If you don't care about progress, provide null . |