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
Nested ClassesModifier 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
FieldsModifier and TypeFieldDescriptionfinal int
Represents a unique identifier for the downloaded item that is persistent across browser sessionsstatic final int
Download interrupted by crash.static final int
File access denied.static final int
File blocked.static final int
Generic file error.static final int
File name too long.static final int
Insufficient disk space.static final int
File security check failed.static final int
File too large.static final int
File download too short.static final int
Transient file error.static final int
File infected by virus.static final int
Network disconnected.static final int
Network request failed.static final int
Invalid network request.static final int
Server is down.static final int
Network timed out.static final int
No interruption.static final int
Server returned bad content.static final int
Server certificate problem.static final int
Server returned a generic error.static final int
Server forbidden request.static final int
Server does not support range requests.static final int
Server unauthorized request.static final int
Download canceled by user.static final int
Download terminated due to user shutdown.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
Constructors -
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_INTERRUPTNo interruption.- See Also:
-
INTERRUPT_REASON_FILE_FAILED
public static final int INTERRUPT_REASON_FILE_FAILEDGeneric file error.- See Also:
-
INTERRUPT_REASON_FILE_ACCESS_DENIED
public static final int INTERRUPT_REASON_FILE_ACCESS_DENIEDFile access denied.- See Also:
-
INTERRUPT_REASON_FILE_NO_SPACE
public static final int INTERRUPT_REASON_FILE_NO_SPACEInsufficient disk space.- See Also:
-
INTERRUPT_REASON_FILE_NAME_TOO_LONG
public static final int INTERRUPT_REASON_FILE_NAME_TOO_LONGFile name too long.- See Also:
-
INTERRUPT_REASON_FILE_TOO_LARGE
public static final int INTERRUPT_REASON_FILE_TOO_LARGEFile too large.- See Also:
-
INTERRUPT_REASON_FILE_VIRUS_INFECTED
public static final int INTERRUPT_REASON_FILE_VIRUS_INFECTEDFile infected by virus.- See Also:
-
INTERRUPT_REASON_FILE_TRANSIENT_ERROR
public static final int INTERRUPT_REASON_FILE_TRANSIENT_ERRORTransient file error.- See Also:
-
INTERRUPT_REASON_FILE_BLOCKED
public static final int INTERRUPT_REASON_FILE_BLOCKEDFile blocked.- See Also:
-
INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED
public static final int INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILEDFile security check failed.- See Also:
-
INTERRUPT_REASON_FILE_TOO_SHORT
public static final int INTERRUPT_REASON_FILE_TOO_SHORTFile download too short.- See Also:
-
INTERRUPT_REASON_NETWORK_FAILED
public static final int INTERRUPT_REASON_NETWORK_FAILEDNetwork request failed.- See Also:
-
INTERRUPT_REASON_NETWORK_TIMEOUT
public static final int INTERRUPT_REASON_NETWORK_TIMEOUTNetwork timed out.- See Also:
-
INTERRUPT_REASON_NETWORK_DISCONNECTED
public static final int INTERRUPT_REASON_NETWORK_DISCONNECTEDNetwork disconnected.- See Also:
-
INTERRUPT_REASON_NETWORK_SERVER_DOWN
public static final int INTERRUPT_REASON_NETWORK_SERVER_DOWNServer is down.- See Also:
-
INTERRUPT_REASON_NETWORK_INVALID_REQUEST
public static final int INTERRUPT_REASON_NETWORK_INVALID_REQUESTInvalid network request.- See Also:
-
INTERRUPT_REASON_SERVER_FAILED
public static final int INTERRUPT_REASON_SERVER_FAILEDServer returned a generic error.- See Also:
-
INTERRUPT_REASON_SERVER_NO_RANGE
public static final int INTERRUPT_REASON_SERVER_NO_RANGEServer does not support range requests.- See Also:
-
INTERRUPT_REASON_SERVER_BAD_CONTENT
public static final int INTERRUPT_REASON_SERVER_BAD_CONTENTServer returned bad content.- See Also:
-
INTERRUPT_REASON_SERVER_UNAUTHORIZED
public static final int INTERRUPT_REASON_SERVER_UNAUTHORIZEDServer unauthorized request.- See Also:
-
INTERRUPT_REASON_SERVER_CERT_PROBLEM
public static final int INTERRUPT_REASON_SERVER_CERT_PROBLEMServer certificate problem.- See Also:
-
INTERRUPT_REASON_SERVER_FORBIDDEN
public static final int INTERRUPT_REASON_SERVER_FORBIDDENServer forbidden request.- See Also:
-
INTERRUPT_REASON_USER_CANCELED
public static final int INTERRUPT_REASON_USER_CANCELEDDownload canceled by user.- See Also:
-
INTERRUPT_REASON_USER_SHUTDOWN
public static final int INTERRUPT_REASON_USER_SHUTDOWNDownload terminated due to user shutdown.- See Also:
-
INTERRUPT_REASON_CRASH
public static final int INTERRUPT_REASON_CRASHDownload interrupted by 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
-