DLTask

class DLTask(val dlBean: DLBean, val listener: DLEventListener) : Callback

Download task.

Since

0.5.2

Constructors

Link copied to clipboard
internal constructor(dlBean: DLBean, listener: DLEventListener)

Properties

Link copied to clipboard
private var completeSize: Long
Link copied to clipboard
private var contentLength: Long
Link copied to clipboard
private val dlBean: DLBean
Link copied to clipboard
private val downloadFile: File
Link copied to clipboard
private val downloadUrl: String
Link copied to clipboard
private val endPos: Long
Link copied to clipboard
private var event: DLEvent
Link copied to clipboard
private var isCancel: Boolean
Link copied to clipboard
private var isPause: Boolean
Link copied to clipboard
Link copied to clipboard
private val md5: String?
Link copied to clipboard
private val okHttpClient: OkHttpClient
Link copied to clipboard
private var requestCall: Call?
Link copied to clipboard
private val startPos: Long

Functions

Link copied to clipboard
fun cancel()

Cancel download. It will cancel the requestCall and delete the downloadFile.

Link copied to clipboard
open override fun onFailure(call: Call, e: IOException)
Link copied to clipboard
open override fun onResponse(call: Call, response: Response)
Link copied to clipboard
fun pause()

Pause download.

Link copied to clipboard
fun resume()

Resume download if current event is not DLEvent.SUCCESS or DLEvent.FAILED.

Link copied to clipboard
fun start()

Start download