Methods
_fetchFileNameFromUrl(url) → {string}
Fetches the file name from an URL
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The URL |
Returns:
The file name
- Type
- string
algorithm(algorithm) → {Downloader}
Sets the algorithm which shall be used to verify the checksum
Parameters:
Name | Type | Description |
---|---|---|
algorithm |
string | The checksum algorithm (e.g. "SHA") |
Returns:
The Downloader object
- Type
- Downloader
checksum(checksum) → {Downloader}
Sets the checksum
Parameters:
Name | Type | Description |
---|---|---|
checksum |
string | The checksum which shall be used to verify the download |
Returns:
The Downloader object
- Type
- Downloader
get() → {String}
Gets the content of the downloaded file
Returns:
The content of downloaded file
- Type
- String
headers(headers) → {Downloader}
Sets the http headers
Parameters:
Name | Type | Description |
---|---|---|
headers |
Object | The http headers |
Returns:
The Downloader object
- Type
- Downloader
json() → {any}
Gets the content of the downloaded file and returns it as a JSON value
Returns:
The json value
- Type
- any
message(message) → {Downloader}
Sets the download message text
Parameters:
Name | Type | Description |
---|---|---|
message |
string | The download message |
Returns:
The Downloader object
- Type
- Downloader
onlyIfUpdateAvailable(onlyIfUpdateAvailable) → {Downloader}
Specifies if the download shall be executed only if a newer version is available
Parameters:
Name | Type | Description |
---|---|---|
onlyIfUpdateAvailable |
boolean | true the download shall be executed only if a newer version is available |
Returns:
The Downloader object
- Type
- Downloader
to(localDestination) → {Downloader}
Sets the download destination
Parameters:
Name | Type | Description |
---|---|---|
localDestination |
string | The destination of the download. If it is a directory, the file will be placed inside |
Returns:
The Downloader object
- Type
- Downloader
url(url) → {Downloader}
Sets the URL which shall be used for the download
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The URL |
Returns:
The Downloader object
- Type
- Downloader
wizard(wizard) → {Downloader}
Sets the setup wizard
Parameters:
Name | Type | Description |
---|---|---|
wizard |
SetupWizard | The setup wizard |
Returns:
The Downloader object
- Type
- Downloader