ExecutionOptions
Stay organized with collections
Save and categorize content based on your preferences.
Constant Summary
int |
CONFLICT_STRATEGY_KEEP_REMOTE
|
A conflict resolution strategy that keeps the
remote version of the file instead of overwriting it with the locally committed
changes when a conflict is detected. |
int |
CONFLICT_STRATEGY_OVERWRITE_REMOTE
|
A conflict resolution strategy that always
overwrites any remote state and applies the locally committed changes on top, even in
case of conflicts. |
int |
MAX_TRACKING_TAG_STRING_LENGTH
|
The maximum tracking tag size in string
length. |
Inherited Method Summary
From class java.lang.Object
Constants
public static final int
CONFLICT_STRATEGY_KEEP_REMOTE
A conflict resolution strategy that keeps the remote version of the file instead of
overwriting it with the locally committed changes when a conflict is detected.
When using this strategy, the caller must also request completion notifications, by
calling setNotifyOnCompletion(boolean)
. Then, in case of conflict the remote state
of the file will be preserved but through the CompletionEvent
,
the client will be able to handle the conflict, access the locally committed changes
that conflicted (and couldn't be persisted on the server), and perform the desired
conflict resolution with all the data. See STATUS_CONFLICT
for more information on how to resolve conflicts.
This strategy can be used with DriveContents
that were either opened in MODE_READ_WRITE
through openFile(DriveFile, int)
, or reopened in MODE_WRITE_ONLY
but obtained through reopenContentsForWrite(DriveContents)
. This is because the API can only
detect conflicts if the written contents are based upon a known revision. In both cases
the base revision is considered the one obtained through the first openFile(DriveFile, int)
.
Constant Value:
1
public static final int
CONFLICT_STRATEGY_OVERWRITE_REMOTE
A conflict resolution strategy that always overwrites any remote state and applies
the locally committed changes on top, even in case of conflicts.
When this strategy is used, the Drive API will not even attempt to detect conflicts
and will always overwrite contents. This strategy can be used with DriveContents
opened in any mode ( MODE_READ_ONLY
, MODE_WRITE_ONLY
or MODE_READ_WRITE
).
Constant Value:
0
public static final int
MAX_TRACKING_TAG_STRING_LENGTH
The maximum tracking tag size in string length.
Constant Value:
65536
Public Methods
public boolean
equals
( Object
o)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eExecutionOptions\u003c/code\u003e configures notification and conflict resolution behavior for Google Drive API requests.\u003c/p\u003e\n"],["\u003cp\u003eUse \u003ccode\u003eExecutionOptions.Builder\u003c/code\u003e to create instances of \u003ccode\u003eExecutionOptions\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTwo conflict resolution strategies are available: \u003ccode\u003eCONFLICT_STRATEGY_KEEP_REMOTE\u003c/code\u003e and \u003ccode\u003eCONFLICT_STRATEGY_OVERWRITE_REMOTE\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCONFLICT_STRATEGY_KEEP_REMOTE\u003c/code\u003e preserves the remote version in case of conflict and requires completion notifications for handling.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCONFLICT_STRATEGY_OVERWRITE_REMOTE\u003c/code\u003e always applies local changes, disregarding any potential conflicts.\u003c/p\u003e\n"]]],[],null,["# ExecutionOptions\n\npublic class **ExecutionOptions** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nOptions that can be included with certain requests to the API to configure notification\nand conflict resolution behavior. Use [ExecutionOptions.Builder](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder)\nto create a new [ExecutionOptions](/android/reference/com/google/android/gms/drive/ExecutionOptions)\nobject. \n\n### Nested Class Summary\n\n|-------|---|---|--------------------------------------------------------------------------------------------------------------------|\n| class | [ExecutionOptions.Builder](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder) || A builder for creating a new [ExecutionOptions](/android/reference/com/google/android/gms/drive/ExecutionOptions). |\n\n### Constant Summary\n\n|-----|-------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| int | [CONFLICT_STRATEGY_KEEP_REMOTE](/android/reference/com/google/android/gms/drive/ExecutionOptions#CONFLICT_STRATEGY_KEEP_REMOTE) | A conflict resolution strategy that keeps the remote version of the file instead of overwriting it with the locally committed changes when a conflict is detected. |\n| int | [CONFLICT_STRATEGY_OVERWRITE_REMOTE](/android/reference/com/google/android/gms/drive/ExecutionOptions#CONFLICT_STRATEGY_OVERWRITE_REMOTE) | A conflict resolution strategy that always overwrites any remote state and applies the locally committed changes on top, even in case of conflicts. |\n| int | [MAX_TRACKING_TAG_STRING_LENGTH](/android/reference/com/google/android/gms/drive/ExecutionOptions#MAX_TRACKING_TAG_STRING_LENGTH) | The maximum tracking tag size in string length. |\n\n### Public Method Summary\n\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/android/gms/drive/ExecutionOptions#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) o) |\n| int | [hashCode](/android/reference/com/google/android/gms/drive/ExecutionOptions#hashCode())() |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nConstants\n---------\n\n#### public static final int\n**CONFLICT_STRATEGY_KEEP_REMOTE**\n\nA conflict resolution strategy that keeps the remote version of the file instead of\noverwriting it with the locally committed changes when a conflict is detected.\n\nWhen using this strategy, the caller must also request completion notifications, by\ncalling [setNotifyOnCompletion(boolean)](/android/reference/com/google/android/gms/drive/ExecutionOptions.Builder#setNotifyOnCompletion(boolean)). Then, in case of conflict the remote state\nof the file will be preserved but through the [CompletionEvent](/android/reference/com/google/android/gms/drive/events/CompletionEvent),\nthe client will be able to handle the conflict, access the locally committed changes\nthat conflicted (and couldn't be persisted on the server), and perform the desired\nconflict resolution with all the data. See [STATUS_CONFLICT](/android/reference/com/google/android/gms/drive/events/CompletionEvent#STATUS_CONFLICT) for more information on how to resolve conflicts.\n\nThis strategy can be used with [DriveContents](/android/reference/com/google/android/gms/drive/DriveContents)\nthat were either opened in [MODE_READ_WRITE](/android/reference/com/google/android/gms/drive/DriveFile#MODE_READ_WRITE)\nthrough [openFile(DriveFile, int)](/android/reference/com/google/android/gms/drive/DriveResourceClient#openFile(com.google.android.gms.drive.DriveFile, int)), or reopened in [MODE_WRITE_ONLY](/android/reference/com/google/android/gms/drive/DriveFile#MODE_WRITE_ONLY)\nbut obtained through [reopenContentsForWrite(DriveContents)](/android/reference/com/google/android/gms/drive/DriveResourceClient#reopenContentsForWrite(com.google.android.gms.drive.DriveContents)). This is because the API can only\ndetect conflicts if the written contents are based upon a known revision. In both cases\nthe base revision is considered the one obtained through the first [openFile(DriveFile, int)](/android/reference/com/google/android/gms/drive/DriveResourceClient#openFile(com.google.android.gms.drive.DriveFile, int)). \nConstant Value: 1 \n\n#### public static final int\n**CONFLICT_STRATEGY_OVERWRITE_REMOTE**\n\nA conflict resolution strategy that always overwrites any remote state and applies\nthe locally committed changes on top, even in case of conflicts.\n\nWhen this strategy is used, the Drive API will not even attempt to detect conflicts\nand will always overwrite contents. This strategy can be used with [DriveContents](/android/reference/com/google/android/gms/drive/DriveContents)\nopened in any mode ([MODE_READ_ONLY](/android/reference/com/google/android/gms/drive/DriveFile#MODE_READ_ONLY),\n[MODE_WRITE_ONLY](/android/reference/com/google/android/gms/drive/DriveFile#MODE_WRITE_ONLY)\nor [MODE_READ_WRITE](/android/reference/com/google/android/gms/drive/DriveFile#MODE_READ_WRITE)). \nConstant Value: 0 \n\n#### public static final int\n**MAX_TRACKING_TAG_STRING_LENGTH**\n\nThe maximum tracking tag size in string length. \nConstant Value: 65536\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) o)\n\n#### public int **hashCode** ()"]]