android-components / mozilla.components.feature.downloads / AbstractFetchDownloadService

AbstractFetchDownloadService

abstract class AbstractFetchDownloadService (source)

Service that performs downloads through a fetch Client rather than through the native Android download manager.

To use this service, you must create a subclass in your application and add it to the manifest.

Types

Name Summary
DownloadJobStatus enum class DownloadJobStatus
Status of an ongoing download

Constructors

Name Summary
<init> AbstractFetchDownloadService()
Service that performs downloads through a fetch Client rather than through the native Android download manager.

Properties

Name Summary
httpClient abstract val httpClient: Client

Functions

Name Summary
onBind open fun onBind(intent: <ERROR CLASS>?): <ERROR CLASS>?
onDestroy open fun onDestroy(): Unit
onStartCommand open fun onStartCommand(intent: <ERROR CLASS>?, flags: Int, startId: Int): Int
onTaskRemoved open fun onTaskRemoved(rootIntent: <ERROR CLASS>?): Unit

Companion Object Properties

Name Summary
ACTION_CANCEL const val ACTION_CANCEL: String
ACTION_OPEN const val ACTION_OPEN: String
ACTION_PAUSE const val ACTION_PAUSE: String
ACTION_RESUME const val ACTION_RESUME: String
ACTION_TRY_AGAIN const val ACTION_TRY_AGAIN: String
EXTRA_DOWNLOAD const val EXTRA_DOWNLOAD: String
EXTRA_DOWNLOAD_STATUS const val EXTRA_DOWNLOAD_STATUS: String

Companion Object Functions

Name Summary
openFile fun openFile(context: <ERROR CLASS>, filePath: String, contentType: String?): Boolean
Launches an intent to open the given file, returns whether or not the file could be opened

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.