java.lang.Object | |
↳ | com.google.android.gms.drive.Contents |
A reference to a Drive file's contents. Any changes made to the FileDescriptor will be local to the app until close or create is called. Once closed you may no longer access the contents via this instance.
Specifically, if these contents refer to an existing file, call
commitAndCloseContents(GoogleApiClient, Contents)
. If these are new contents, provide them to create a new
file programatically via createFile(GoogleApiClient, MetadataChangeSet, Contents)
or set them as the initial contents in
the create file dialog: newCreateFileActivityBuilder()
.
[Expand]
Inherited Constants | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]()
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the
DriveId for the file that owns these contents. | |||||||||||
Gets an InputStream that allows you to read this file's contents.
| |||||||||||
Gets the mode the contents were opened in.
| |||||||||||
Gets an OutputStream that allows you to write new contents.
| |||||||||||
Gets a FileDescriptor that points to the Drive file's contents.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||||||||||||||||||||||||
![]() |
Gets the DriveId
for the file that owns these contents. Will be null if these are new
contents.
Gets an InputStream that allows you to read this file's contents. This method may only be
used with files opened with MODE_READ_ONLY
; to read/write from a file
opened with MODE_READ_WRITE
, use the file descriptor returned by
getParcelFileDescriptor()
. This method may only be called once per Contents
instance.
Gets the mode the contents were opened in.
Gets an OutputStream that allows you to write new contents. This method may only be used
with files opened with MODE_WRITE_ONLY
; to read/write from a file opened
with MODE_READ_WRITE
, use the file descriptor returned by
getParcelFileDescriptor()
. This method may only be called once per Contents
instance.
Gets a FileDescriptor that points to the Drive file's contents. If this file was opened with
MODE_READ_ONLY
or MODE_READ_WRITE
, the file referenced by
the FileDescriptor will contain the most recent version of the file. Otherwise, the file will
be empty.