BGE/Downloads

Alias: BGE.Downloads


Static Methods

getFolder(useCache: boolean): string

static

The folder downloads are written to.

Parameters

  • useCache (boolean) — true for the cachefs: cache, false for tmp:

Returns

  • string

getPath(url: string, useCache: boolean): string

static

The local file a URL downloads to when its own extension is used: the MD5 of the URL plus the URL's extension, so the same URL always maps to the same file and the loaders can still tell the file type.

Parameters

  • url (string)
  • useCache (boolean) — true for the cachefs: cache, false for tmp:

Returns

  • string

getBasePath(url: string, useCache: boolean): string

static

The local file a URL downloads to, without an extension: the download folder plus the MD5 of the URL. The downloaded file is this plus the extension of its type.

Parameters

  • url (string)
  • useCache (boolean) — true for the cachefs: cache, false for tmp:

Returns

  • string

Other

CACHE_FOLDER

staticreadonly

Where downloads are cached between launches (the OS may clear it when space runs low)

Default: cachefs:/bge

TEMP_FOLDER

staticreadonly

Where downloads with cache: false go - cleared when the channel exits

Default: tmp:/bge