public interface UnbluDownloadHandler
Modifier and Type | Method and Description |
---|---|
static UnbluDownloadHandler |
createExternalStorageDownloadHandler(android.content.Context context)
Creates a default implementation of
UnbluDownloadHandler which stores the files in the public downloads directory. |
void |
onDownloadStart(java.lang.String requestedUrl,
java.lang.String userAgent,
java.lang.String contentDisposition,
java.lang.String mimeType,
long contentLength,
java.lang.String cookies)
Triggered whenever a download is started.
|
default void |
onWebViewDestroy()
Called whenever the webView is destroyed.
|
default void |
onWebViewInitialize()
Called whenever the webView is initialized.
|
static UnbluDownloadHandler createExternalStorageDownloadHandler(android.content.Context context)
UnbluDownloadHandler
which stores the files in the public downloads directory.context
- The context of the applicationSharedPreferences
void onDownloadStart(java.lang.String requestedUrl, java.lang.String userAgent, java.lang.String contentDisposition, java.lang.String mimeType, long contentLength, java.lang.String cookies)
android.webkit.DownloadListener
of WebView
s.
MimeType and content disposition are may not present and an additional HEAD request has do be done to retrieve those information from the server.
requestedUrl
- The full url to the content that should be downloadeduserAgent
- the user agent to be used for the download.contentDisposition
- Content-disposition http header, if present.mimeType
- The mimeType of the content reported by the server.cookies
- The cookies used inside the WebView which are relevant for this request. They may have to be added to the request to have access to the file.contentLength
- Content-Lengthdefault void onWebViewInitialize()
default void onWebViewDestroy()