Package org.mozilla.geckoview
Class WebExtension.Download
Object
org.mozilla.geckoview.WebExtension.Download
- Enclosing class:
- WebExtension
Represents a download for downloads
API Instantiate using
WebExtensionController.createDownload(int)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
Represents a possible reason why a download was interrupted.static @interface
Represents a download in progress where the app is currently receiving data from the server.static interface
Interface for communicating the state of downloads to Web Extensions. -
Field Summary
Modifier and TypeFieldDescriptionfinal int
Represents a unique identifier for the downloaded item that is persistent across browser sessionsstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
The download completed successfully.static final int
Download is in progress.static final int
An error broke the connection with the server. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionUpdates the download state.
-
Field Details
-
id
public final int idRepresents a unique identifier for the downloaded item that is persistent across browser sessions -
STATE_IN_PROGRESS
public static final int STATE_IN_PROGRESSDownload is in progress. Default state- See Also:
-
STATE_INTERRUPTED
public static final int STATE_INTERRUPTEDAn error broke the connection with the server.- See Also:
-
STATE_COMPLETE
public static final int STATE_COMPLETEThe download completed successfully.- See Also:
-
INTERRUPT_REASON_NO_INTERRUPT
public static final int INTERRUPT_REASON_NO_INTERRUPT- See Also:
-
INTERRUPT_REASON_FILE_FAILED
public static final int INTERRUPT_REASON_FILE_FAILED- See Also:
-
INTERRUPT_REASON_FILE_ACCESS_DENIED
public static final int INTERRUPT_REASON_FILE_ACCESS_DENIED- See Also:
-
INTERRUPT_REASON_FILE_NO_SPACE
public static final int INTERRUPT_REASON_FILE_NO_SPACE- See Also:
-
INTERRUPT_REASON_FILE_NAME_TOO_LONG
public static final int INTERRUPT_REASON_FILE_NAME_TOO_LONG- See Also:
-
INTERRUPT_REASON_FILE_TOO_LARGE
public static final int INTERRUPT_REASON_FILE_TOO_LARGE- See Also:
-
INTERRUPT_REASON_FILE_VIRUS_INFECTED
public static final int INTERRUPT_REASON_FILE_VIRUS_INFECTED- See Also:
-
INTERRUPT_REASON_FILE_TRANSIENT_ERROR
public static final int INTERRUPT_REASON_FILE_TRANSIENT_ERROR- See Also:
-
INTERRUPT_REASON_FILE_BLOCKED
public static final int INTERRUPT_REASON_FILE_BLOCKED- See Also:
-
INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED
public static final int INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED- See Also:
-
INTERRUPT_REASON_FILE_TOO_SHORT
public static final int INTERRUPT_REASON_FILE_TOO_SHORT- See Also:
-
INTERRUPT_REASON_NETWORK_FAILED
public static final int INTERRUPT_REASON_NETWORK_FAILED- See Also:
-
INTERRUPT_REASON_NETWORK_TIMEOUT
public static final int INTERRUPT_REASON_NETWORK_TIMEOUT- See Also:
-
INTERRUPT_REASON_NETWORK_DISCONNECTED
public static final int INTERRUPT_REASON_NETWORK_DISCONNECTED- See Also:
-
INTERRUPT_REASON_NETWORK_SERVER_DOWN
public static final int INTERRUPT_REASON_NETWORK_SERVER_DOWN- See Also:
-
INTERRUPT_REASON_NETWORK_INVALID_REQUEST
public static final int INTERRUPT_REASON_NETWORK_INVALID_REQUEST- See Also:
-
INTERRUPT_REASON_SERVER_FAILED
public static final int INTERRUPT_REASON_SERVER_FAILED- See Also:
-
INTERRUPT_REASON_SERVER_NO_RANGE
public static final int INTERRUPT_REASON_SERVER_NO_RANGE- See Also:
-
INTERRUPT_REASON_SERVER_BAD_CONTENT
public static final int INTERRUPT_REASON_SERVER_BAD_CONTENT- See Also:
-
INTERRUPT_REASON_SERVER_UNAUTHORIZED
public static final int INTERRUPT_REASON_SERVER_UNAUTHORIZED- See Also:
-
INTERRUPT_REASON_SERVER_CERT_PROBLEM
public static final int INTERRUPT_REASON_SERVER_CERT_PROBLEM- See Also:
-
INTERRUPT_REASON_SERVER_FORBIDDEN
public static final int INTERRUPT_REASON_SERVER_FORBIDDEN- See Also:
-
INTERRUPT_REASON_USER_CANCELED
public static final int INTERRUPT_REASON_USER_CANCELED- See Also:
-
INTERRUPT_REASON_USER_SHUTDOWN
public static final int INTERRUPT_REASON_USER_SHUTDOWN- See Also:
-
INTERRUPT_REASON_CRASH
public static final int INTERRUPT_REASON_CRASH- See Also:
-
-
Constructor Details
-
Download
protected Download(int id) For testing.- Parameters:
id
- - integer id for the download item
-
-
Method Details
-
update
Updates the download state. This will trigger a call to downloads.onChanged event to the corresponding `DownloadItem` on the extension side.- Parameters:
data
- - current metadata associated with the download.WebExtension.Download.Info
implementation instance- Returns:
- GeckoResult with nothing or error inside
-