Represents a download task.
Returned by downloadToFile() to allow querying and controlling the download task.
Public Types | |
| using | Listener = DownloadTaskListener |
Public Member Functions | |
| virtual | ~DownloadTask () |
| Releases the resources of the download task, unregisters the listener and cancels the download if necessary. | |
| int64 | getTotalLength () const |
| Returns the total length of the download task. | |
| int64 | getLengthDownloaded () const |
| Returns the number of bytes that have been downloaded so far. | |
| bool | isFinished () const |
| Returns true if the download finished or there was an error. | |
| int | statusCode () const |
| Returns the status code of the server's response. | |
| bool | hadError () const |
| Returns true if there was an error. | |
| File | getTargetLocation () const |
| Returns the target file location that was provided in URL::downloadToFile. | |
Static Public Member Functions | |
| static void | juce_iosURLSessionNotify (const String &) |
| internal | |
Protected Member Functions | |
| DownloadTask () | |
Protected Attributes | |
| int64 | contentLength = -1 |
| int64 | downloaded = 0 |
| bool | finished = false |
| bool | error = false |
| int | httpCode = -1 |
| File | targetLocation |
|
virtual |
Releases the resources of the download task, unregisters the listener and cancels the download if necessary.
|
protected |
Referenced by juce_iosURLSessionNotify().
|
inline |
Returns the total length of the download task.
This may return -1 if the length was not returned by the server.
References contentLength.
|
inline |
Returns the number of bytes that have been downloaded so far.
References downloaded.
|
inline |
Returns true if the download finished or there was an error.
References finished.
|
inline |
Returns the status code of the server's response.
This will only be valid after the download has finished.
References httpCode.
|
inline |
Returns true if there was an error.
References error.
|
inline |
Returns the target file location that was provided in URL::downloadToFile.
References targetLocation.
|
static |
internal
References DownloadTask().
|
protected |
Referenced by getTotalLength().
|
protected |
Referenced by getLengthDownloaded().
|
protected |
Referenced by isFinished().
|
protected |
Referenced by hadError().
|
protected |
Referenced by statusCode().
|
protected |
Referenced by getTargetLocation().