Class: Downloadable

(package) downloader.Downloadable(url)

A Downloadable object represents a downloadable resource.

Constructor

(package) new Downloadable(url)

Creates an object that can be downloaded by the downloader.

Parameters:
Name Type Description
url string

URL that has to be requested for the object

Source:

Members

downloadCount :number

Number indicating how often the object was downloaded.

Type:
  • number
Source:

(package, nullable) firstVersion :string

A string indicating the version of the first ever downloaded resource, in YYYY[MM[DD]][-E] format or just "0" or "0-E".

Note that unlike module:downloader.Downloadable#lastVersion this property is related to analytics and its value is common across all downloadable resources.

If module:downloader.Downloadable#url is not a trusted URL, the value of this property should be set to null.

Type:
  • string
Source:
See:

hardExpiration :number

Hard expiration time in milliseconds since the Unix epoch. This is fixed.

Updates should be downloaded if module:downloader.Downloadable#softExpiration or hardExpiration are in the past.

Type:
  • number
Source:

lastCheck :number

Time of last check whether the object needs downloading.

Type:
  • number
Source:

lastError :number

Time of last download error or 0 if the last download was successful.

Type:
  • number
Source:

lastVersion :number

Object version corresponding to the last successful download.

Type:
  • number
Source:

method :string

Request method to use, which is either "GET" or "HEAD".

Type:
  • string
Source:

(nullable) redirectURL :string

URL that the download was redirected to if any.

Type:
  • string
Source:

softExpiration :number

Soft expiration time in milliseconds since the Unix epoch. This will increase if no checks are performed for a while.

Updates should be downloaded if softExpiration or module:downloader.Downloadable#hardExpiration are in the past.

Type:
  • number
Source:

url :string

URL that has to be requested for the object.

Type:
  • string
Source: