public class PRDownloader
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static void |
cancel(int downloadId) |
Method to cancel request with the given downloadId
|
static void |
cancel(java.lang.Object tag) |
Method to cancel requests with the given tag
|
static void |
cancelAll() |
Method to cancel all requests
|
static void |
cleanUp(int days) |
Method to clean up temporary resumed files which is older than the given day
|
static DownloadRequestBuilder |
download(java.lang.String url,
java.lang.String dirPath,
java.lang.String fileName) |
Method to make download request
|
static Status |
getStatus(int downloadId) |
Method to check the request with the given downloadId is running or not
|
static void |
initialize(android.content.Context context) |
Initializes PRDownloader with the default config.
|
static void |
initialize(android.content.Context context,
PRDownloaderConfig config) |
Initializes PRDownloader with the custom config.
|
static void |
pause(int downloadId) |
Method to pause request with the given downloadId
|
static void |
resume(int downloadId) |
Method to resume request with the given downloadId
|
static void |
shutDown() |
Shuts PRDownloader down
|
public static void initialize(android.content.Context context)
context - The contextpublic static void initialize(android.content.Context context,
PRDownloaderConfig config)
context - The contextconfig - The PRDownloaderConfigpublic static DownloadRequestBuilder download(java.lang.String url, java.lang.String dirPath, java.lang.String fileName)
url - The url on which request is to be madedirPath - The directory path on which file is to be savedfileName - The file name with which file is to be savedpublic static void pause(int downloadId)
downloadId - The downloadId with which request is to be pausedpublic static void resume(int downloadId)
downloadId - The downloadId with which request is to be resumedpublic static void cancel(int downloadId)
downloadId - The downloadId with which request is to be cancelledpublic static void cancel(java.lang.Object tag)
tag - The tag with which requests are to be cancelledpublic static void cancelAll()
public static Status getStatus(int downloadId)
downloadId - The downloadId with which request status is to be checkedpublic static void cleanUp(int days)
days - the dayspublic static void shutDown()