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 @interfaceRepresents a possible reason why a download was interrupted.static @interfaceRepresents a download in progress where the app is currently receiving data from the server.static interfaceInterface for communicating the state of downloads to Web Extensions. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intRepresents a unique identifier for the downloaded item that is persistent across browser sessionsstatic final intDownload interrupted by crash.static final intFile access denied.static final intFile blocked.static final intGeneric file error.static final intFile name too long.static final intInsufficient disk space.static final intFile security check failed.static final intFile too large.static final intFile download too short.static final intTransient file error.static final intFile infected by virus.static final intNetwork disconnected.static final intNetwork request failed.static final intInvalid network request.static final intServer is down.static final intNetwork timed out.static final intNo interruption.static final intServer returned bad content.static final intServer certificate problem.static final intServer returned a generic error.static final intServer forbidden request.static final intServer does not support range requests.static final intServer unauthorized request.static final intDownload canceled by user.static final intDownload terminated due to user shutdown.static final intThe download completed successfully.static final intDownload is in progress.static final intAn 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.Infoimplementation instance- Returns:
- GeckoResult with nothing or error inside
-