java.lang.Object | |
↳ | com.google.android.gms.drive.DriveId |
A canonical identifier for a Drive resource. The identifier can be converted to a String
representation for storage using encodeToString()
and then later converted back
to the ID representation using decodeFromString(String)
.
equals(Object)
can be used to see if two different identifiers refer to the
same resource.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | RESOURCE_TYPE_FILE | A file resource type, meaning the DriveId corresponds to a file. |
|||||||||
int | RESOURCE_TYPE_FOLDER | A folder resource type, meaning the DriveId corresponds to a folder. |
|||||||||
int | RESOURCE_TYPE_UNKNOWN | An unknown resource type, meaning the DriveId corresponds to either a file or a
folder. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a
DriveFolder object that can be used to interact with the folder specified
by this DriveId . | |||||||||||
Returns a
DriveResource object that can be used to interact with the file or folder
specified by this DriveId . | |||||||||||
Decodes the result of
encodeToString() back into a DriveId . | |||||||||||
Returns a String representation of this
DriveId that can be safely
persisted, and from which an equivalent DriveId can later be
reconstructed using decodeFromString(String) . | |||||||||||
Returns the remote Drive resource id associated with the resource.
| |||||||||||
Returns the resource type corresponding to this
DriveId . | |||||||||||
Returns an invariant string for this
DriveId . | |||||||||||
Returns a String representation of the ID.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
A file resource type, meaning the DriveId
corresponds to a file.
A folder resource type, meaning the DriveId
corresponds to a folder.
An unknown resource type, meaning the DriveId
corresponds to either a file or a
folder.
Returns a DriveFile
object that can be used to interact with the file specified by
this DriveId
.
Returns | |
---|---|
DriveFile |
Throws | |
---|---|
IllegalStateException |
if this DriveId is of type
RESOURCE_TYPE_FOLDER
|
Returns a DriveFolder
object that can be used to interact with the folder specified
by this DriveId
.
Returns | |
---|---|
DriveFolder |
Throws | |
---|---|
IllegalStateException |
if this DriveId is of type RESOURCE_TYPE_FILE
|
Returns a DriveResource
object that can be used to interact with the file or folder
specified by this DriveId
.
This method is useful when you want to perform actions that are applicable for both files
and folders. You can later cast the returned DriveResource
to a DriveFile
or
a DriveFolder
, depending on the type of this DriveId
.
Returns | |
---|---|
DriveResource |
Decodes the result of encodeToString()
back into a DriveId
.
Parameters | |
---|---|
s |
String
|
Returns | |
---|---|
DriveId |
Throws | |
---|---|
IllegalArgumentException |
if the argument is not a valid result of
encodeToString() .
|
Returns a String representation of this DriveId
that can be safely
persisted, and from which an equivalent DriveId
can later be
reconstructed using decodeFromString(String)
.
The String representation is not guaranteed to be stable over time for a given resource so
should never be compared for equality. Always use decodeFromString(String)
and
then equals(Object)
to compare two identifiers to see if they refer to the
same resource. Otherwise, toInvariantString()
is stable and can be safely
used for DriveId
comparison.
Returns | |
---|---|
String |
Parameters | |
---|---|
obj |
Object
|
Returns | |
---|---|
boolean |
Returns the remote Drive resource id associated with the resource. May be null
for
local resources that have not yet been synchronized to the Drive service.
Returns | |
---|---|
String |
Returns the resource type corresponding to this DriveId
. Possible values are
RESOURCE_TYPE_FILE
, RESOURCE_TYPE_FOLDER
or RESOURCE_TYPE_UNKNOWN
.
The RESOURCE_TYPE_UNKNOWN
will only be returned if the DriveId
instance has
been created using decodeFromString(String)
, with an old string that was generated and
persisted by the client with an old version of Google Play Services. If the client is not
encoding, persisting and decoding DriveId
s, this method will always return either
RESOURCE_TYPE_FILE
or RESOURCE_TYPE_FOLDER
.
Returns | |
---|---|
int |
Returns | |
---|---|
int |
Returns an invariant string for this DriveId
. This is stable over time, so for a
given DriveId
, this value will always remain the same, and is guaranteed to be unique
for each DriveId
. The client can use it directly to compare equality of
DriveId
s, since two DriveId
s are equal if and only if its invariant string
is equal.
Note: This value cannot be used to decodeFromString(String)
, since it's not meant
to encode a DriveId
, but can be useful for client-side string-based DriveId
comparison, or for logging purposes.
Returns | |
---|---|
String |
Returns a String representation of the ID. Use encodeToString()
to obtain a
String representation that can decoded back to a DriveId
.
Returns | |
---|---|
String |
Parameters | |
---|---|
out |
Parcel
|
flags |
int
|