FileCache

Wick. FileCache

Global utility class for storing and retrieving large file data.

Constructor

new FileCache()

Source:

Members

(static) FILE_LOCALFORAGE_KEY_PREFIX :string

Description:
  • A prefix to use in localforage so we can identify which items in localforage are files.

Source:

A prefix to use in localforage so we can identify which items in localforage are files.

Type:
  • string

Methods

(static) addFile(src, uuid)

Description:
  • Add a file to the cache.

Source:
Parameters:
Name Type Description
src string

The file source

uuid string

The UUID of the file

(static) clear()

Description:
  • Clear the cache.

Source:

(static) getAllFiles() → {object}

Description:
  • On object containing all files in WickFileCache.

Source:
Returns:

All the files in an object with the format:

Type
object

(static) getFile(uuid) → {object}

Description:
  • Get info for a file by its UUID.

Source:
Parameters:
Name Type Description
uuid string

The UUID of the file

Returns:

The file info

Type
object

(static) loadFilesFromLocalforage(project, callback)

Description:
  • Loads all files from local forage associated with a previously saved project, if possible.

Source:
Parameters:
Name Type Description
project Wick.Project

the project that we want to load assets for.

callback function

called when the assets are done being loaded.

(static) removeFile(uuid)

Description:
  • Removes a file from the FileCache with a given UUID.

Source:
Parameters:
Name Type Description
uuid string

the UUID of the file to remove.