Class: Downloader

Downloader()

Downloader class

Constructor

new Downloader()

Source:

Methods

_fetchFileNameFromUrl(url) → {string}

Fetches the file name from an URL
Parameters:
Name Type Description
url string The URL
Source:
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")
Source:
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
Source:
Returns:
The Downloader object
Type
Downloader

get() → {String}

Gets the content of the downloaded file
Source:
Returns:
The content of downloaded file
Type
String

headers(headers) → {Downloader}

Sets the http headers
Parameters:
Name Type Description
headers Object The http headers
Source:
Returns:
The Downloader object
Type
Downloader

json() → {any}

Gets the content of the downloaded file and returns it as a JSON value
Source:
Returns:
The json value
Type
any

message(message) → {Downloader}

Sets the download message text
Parameters:
Name Type Description
message string The download message
Source:
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
Source:
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
Source:
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
Source:
Returns:
The Downloader object
Type
Downloader

wizard(wizard) → {Downloader}

Sets the setup wizard
Parameters:
Name Type Description
wizard SetupWizard The setup wizard
Source:
Returns:
The Downloader object
Type
Downloader