OpenFileCallback
Stay organized with collections
Save and categorize content based on your preferences.
Public Constructor Summary
Public Method Summary
abstract void |
|
abstract void |
|
abstract void |
onProgress
(long bytesDownloaded, long bytesExpected) Called while the file is being downloaded to report download progress.
|
Inherited Method Summary
From class java.lang.Object
Public Constructors
public
OpenFileCallback
()
Public Methods
public abstract void
onContents
( DriveContents
contents)
Called when the file is downloaded.
public abstract void
onError
( Exception
exception)
Called when there is an error opening the file.
public abstract void
onProgress
(long bytesDownloaded,
long bytesExpected)
Called while the file is being downloaded to report download progress.
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\u003eOpenFileCallback\u003c/code\u003e is an abstract class used to track the progress of downloading file contents from Google Drive.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to handle successful downloads (\u003ccode\u003eonContents\u003c/code\u003e), errors (\u003ccode\u003eonError\u003c/code\u003e), and progress updates (\u003ccode\u003eonProgress\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eDevelopers need to extend this class and implement these methods to interact with the download process.\u003c/p\u003e\n"],["\u003cp\u003eThe callback is triggered when using \u003ccode\u003eDriveResourceClient.openFile()\u003c/code\u003e to open a \u003ccode\u003eDriveFile\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# OpenFileCallback\n\npublic abstract class **OpenFileCallback** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nA callback for progress events on an active file contents download. This listener can be\npassed to [openFile(com.google.android.gms.drive.DriveFile, int, OpenFileCallback)](/android/reference/com/google/android/gms/drive/DriveResourceClient#openFile(com.google.android.gms.drive.DriveFile, int, com.google.android.gms.drive.events.OpenFileCallback)). \n\n### Public Constructor Summary\n\n|---|------------------------------------------------------------------------------------------------------------------|\n| | [OpenFileCallback](/android/reference/com/google/android/gms/drive/events/OpenFileCallback#OpenFileCallback())() |\n\n### Public Method Summary\n\n|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [onContents](/android/reference/com/google/android/gms/drive/events/OpenFileCallback#onContents(com.google.android.gms.drive.DriveContents))([DriveContents](/android/reference/com/google/android/gms/drive/DriveContents) contents) Called when the file is downloaded. |\n| abstract void | [onError](/android/reference/com/google/android/gms/drive/events/OpenFileCallback#onError(java.lang.Exception))([Exception](//developer.android.com/reference/java/lang/Exception.html) exception) Called when there is an error opening the file. |\n| abstract void | [onProgress](/android/reference/com/google/android/gms/drive/events/OpenFileCallback#onProgress(long, long))(long bytesDownloaded, long bytesExpected) Called while the file is being downloaded to report download progress. |\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\nPublic Constructors\n-------------------\n\n#### public **OpenFileCallback** ()\n\nPublic Methods\n--------------\n\n#### public abstract void **onContents** ([DriveContents](/android/reference/com/google/android/gms/drive/DriveContents) contents)\n\nCalled when the file is downloaded. \n\n#### public abstract void **onError** ([Exception](//developer.android.com/reference/java/lang/Exception.html) exception)\n\nCalled when there is an error opening the file. \n\n#### public abstract void **onProgress** (long bytesDownloaded, long bytesExpected)\n\nCalled while the file is being downloaded to report download progress."]]