Loading...
Searching...
No Matches
juce::URL::DownloadTask Class Reference

## Detailed Description

Represents a download task.

Returned by downloadToFile() to allow querying and controlling the download task.

The documentation for this class was generated from the following file:

- juce_core/network/juce_URL.h

## 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

## Member Typedef Documentation

## Listener

using juce::URL::DownloadTask::Listener = DownloadTaskListener

## Constructors and Destructors

## ~DownloadTask()

virtual juce::URL::DownloadTask::~DownloadTask | ( |  | ) |

virtual

Releases the resources of the download task, unregisters the listener and cancels the download if necessary.

## DownloadTask()

juce::URL::DownloadTask::DownloadTask | ( |  | ) |

protected

Referenced by juce_iosURLSessionNotify().

## Member Functions

## getTotalLength()

int64 juce::URL::DownloadTask::getTotalLength | ( |  | ) | const

inline

Returns the total length of the download task.

This may return -1 if the length was not returned by the server.

References contentLength.

## getLengthDownloaded()

int64 juce::URL::DownloadTask::getLengthDownloaded | ( |  | ) | const

inline

Returns the number of bytes that have been downloaded so far.

References downloaded.

## isFinished()

bool juce::URL::DownloadTask::isFinished | ( |  | ) | const

inline

Returns true if the download finished or there was an error.

References finished.

## statusCode()

int juce::URL::DownloadTask::statusCode | ( |  | ) | const

inline

Returns the status code of the server's response.

This will only be valid after the download has finished.

See also
  isFinished

References httpCode.

## hadError()

bool juce::URL::DownloadTask::hadError | ( |  | ) | const

inline

Returns true if there was an error.

References error.

## getTargetLocation()

File juce::URL::DownloadTask::getTargetLocation | ( |  | ) | const

inline

Returns the target file location that was provided in URL::downloadToFile.

References targetLocation.

## juce_iosURLSessionNotify()

void juce::URL::DownloadTask::juce_iosURLSessionNotify | ( | const String & |  | ) |

static

internal

References DownloadTask().

## Member Data Documentation

## contentLength

int64 juce::URL::DownloadTask::contentLength = -1

protected

Referenced by getTotalLength().

## downloaded

int64 juce::URL::DownloadTask::downloaded = 0

protected

Referenced by getLengthDownloaded().

## finished

bool juce::URL::DownloadTask::finished = false

protected

Referenced by isFinished().

## error

bool juce::URL::DownloadTask::error = false

protected

Referenced by hadError().

## httpCode

int juce::URL::DownloadTask::httpCode = -1

protected

Referenced by statusCode().

## targetLocation

File juce::URL::DownloadTask::targetLocation

protected

Referenced by getTargetLocation().

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited