public interface Downloader
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Interrupts any current download operation and prevents future operations from running.
|
void |
download()
Downloads the media.
|
long |
getDownloadedBytes()
Returns the total number of downloaded bytes.
|
float |
getDownloadPercentage()
Returns the estimated download percentage, or
C.PERCENTAGE_UNSET if no estimate is
available. |
void |
remove()
Removes the media.
|
void download() throws InterruptedException, IOException
DownloadException
- Thrown if the media cannot be downloaded.InterruptedException
- If the thread has been interrupted.IOException
- Thrown when there is an io error while downloading.void cancel()
long getDownloadedBytes()
float getDownloadPercentage()
C.PERCENTAGE_UNSET
if no estimate is
available.void remove() throws InterruptedException
InterruptedException
- Thrown if the thread was interrupted.