Modifier and Type | Class and Description |
---|---|
static interface |
DownloadTask.DownloadListener
Interface which allows a Listener to be updated upon the completion of a
DownloadTask . |
AsyncTask.Status
SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR
Constructor and Description |
---|
DownloadTask(String destDirectory,
String extension,
DownloadTask.DownloadListener downloadListener)
Creates a DownloadTask with a blank file name, so each subsequent file will just be named
numerically.
|
DownloadTask(String destDirectory,
String fileName,
String extension,
DownloadTask.DownloadListener downloadListener)
Creates a DownloadTask which will download the input stream into the given
destinationDirectory with the specified file name and file extension.
|
Modifier and Type | Method and Description |
---|---|
protected File |
doInBackground(okhttp3.ResponseBody... responseBodies) |
protected void |
onPostExecute(File instructionFile) |
cancel, execute, execute, executeOnExecutor, get, get, getStatus, isCancelled, onCancelled, onCancelled, onPreExecute, onProgressUpdate, publishProgress
public DownloadTask(String destDirectory, String extension, DownloadTask.DownloadListener downloadListener)
destDirectory
- path to the directory where file should be downloadedextension
- file extension of the resulting filedownloadListener
- listener to be updated on completion of the taskpublic DownloadTask(String destDirectory, String fileName, String extension, DownloadTask.DownloadListener downloadListener)
destDirectory
- path to the directory where file should be downloadedfileName
- name to name the fileextension
- file extension of the resulting filedownloadListener
- listener to be updated on completion of the taskprotected File doInBackground(okhttp3.ResponseBody... responseBodies)
doInBackground
in class AsyncTask<okhttp3.ResponseBody,Void,File>
protected void onPostExecute(File instructionFile)
onPostExecute
in class AsyncTask<okhttp3.ResponseBody,Void,File>
© 2019 Mapbox. All rights reserved.