public class Downloader extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
Downloader.DownloadTask
The type Download task.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
FILE_CANCELED
The constant FILE_CANCELED.
|
static int |
FILE_COMPLETED
The constant FILE_COMPLETED.
|
static int |
FILE_DOWNLOADING
The constant FILE_DOWNLOADING.
|
static int |
FILE_FAILURE
The constant FILE_FAILURE.
|
static int |
FILE_QUEUED
The constant FILE_QUEUED.
|
| Constructor and Description |
|---|
Downloader(TelegramApi api)
Instantiates a new Downloader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancelTask(int taskId)
Cancel task.
|
TelegramApi |
getApi()
Gets api.
|
int |
getTaskState(int taskId)
Gets task state.
|
int |
requestTask(int dcId,
TLAbsInputFileLocation location,
int size,
String destFile,
DownloadListener listener)
Request task.
|
void |
waitForTask(int taskId)
Wait for task.
|
public static final int FILE_QUEUED
public static final int FILE_DOWNLOADING
public static final int FILE_COMPLETED
public static final int FILE_CANCELED
public static final int FILE_FAILURE
public Downloader(TelegramApi api)
api - the apipublic TelegramApi getApi()
public void cancelTask(int taskId)
taskId - the task idpublic int getTaskState(int taskId)
taskId - the task idpublic void waitForTask(int taskId)
taskId - the task idpublic int requestTask(int dcId,
TLAbsInputFileLocation location,
int size,
String destFile,
DownloadListener listener)
dcId - the dc idlocation - the locationsize - the sizedestFile - the dest filelistener - the listenerCopyright © 2016. All rights reserved.