FileDownloaderParams

提供一个文件下载事件所需的所有参数和元数据。

当 WebView 或其他组件触发文件下载时,一个实现了此接口的对象 会被传递给下载监听器或处理器,以便宿主应用可以根据这些信息 来正确处理下载请求。

Functions

Link copied to clipboard
abstract fun getContentDisposition(): String?

获取服务器响应中的 Content-Disposition HTTP 标头值。

Link copied to clipboard
abstract fun getContentLength(): Long

获取服务器报告的文件大小,单位为字节(bytes)。

Link copied to clipboard
abstract fun getMimetype(): String?

获取服务器报告的内容的 MIME 类型。

Link copied to clipboard
abstract fun getUrl(): String?

获取需要被下载内容的完整 URL。

Link copied to clipboard
abstract fun getUserAgent(): String?

获取执行下载请求时应使用的用户代理(User Agent)字符串。