The assetpool object represents a pool of files for synchronization. An asset pool is populated with the assetpoolfetcher object.
To create an assetpool object, first load the
brightsign/assetpool module using the
Require() method. Then create an instance of the assetpool class with a string value specifying the pool path.
Use this interface to perform operations on the asset pool.
Requests that a set of files in the asset pool be protected from deletion when the system software needs to prune files from the pool to make space. The passed
name is used to reference the set of files if their protection needs to be removed later using the
Removes protection from a set of files that have been protected using the
Reserves the specified amount of storage space (in megabytes). This method is persistent: The system software attempts to keep the specified amount of space free even as parallel processes fill up the storage.
Specifies the maximum size of the asset pool (in megabytes). This method is more resource-intensive than
reserveStorage(), but it is useful when creating multiple pools on a storage device.
Returns the current size of the asset pool (in megabytes).
Compares the passed file hash values against the hash values of the files in the asset pool. This method returns a ValidationResultList interface containing validation results for each file. The second parameter is a
ValidationOptions interface specifying validation options.
Determines whether the specified files are present in the asset pool. This method returns a QueryResultAssetList interface containing query results.
true if the specified files are ready in the asset pool.
This interface represents a set of files in the asset pool. Each entry in the list contains the following parameters:
[DOMString] name: The filename. For a file to be realized, it must have a valid filename (i.e. no slashes).
[DOMString] link: The download URL of the file
[long] size: The file length (in bytes)
[Hash] hash: A Hash interface specifying the hash algorithm and hash value of the file
[DOMString] changeHint: An arbitrary value that can be used by the client to specify that a file has changed even when the hash value and download URL remain the same.
[optional] [Authentication] auth: An Authentication interface specifying the credentials to use when downloading the asset. By default, credentials are inherited from the assetpoolfetcher instance used to download the asset.
[optional] [HeaderList] headers: A HeaderList interface specifying headers that are passed to the download URL. By default, headers are inherited from the assetpoolfetcher instance used to download the asset.
[DOMString] probe: The media probe data
This interface contains validation options for the
[DOMString] deleteCorruptFiles: A flag specifying whether corrupt files should be deleted during validation
This interface contains hash information about the file.
[DOMString] method: The hash algorithm. Accepted values include "SHA1", "BESHA1", and "MD5".
[DOMString] hex: The hash value in hexidecimal format
This interface contains authentication information for downloading files.
[DOMString] user: The user name for authentication
[DOMString] password: The password for authentication
This interface contains a list of headers to pass to a file download URL. Each entry in the list contains the following parameters:
[DOMString] name: The header name
[DOMString] value: The header value
This interface is returned by the
queryFiles() method. Each entry in the list contains the following parameters:
[DOMString] name: The name of the queried file
[bool] present: A flag indicating whether the queried file exists in the asset pool
This interface is returned by the
validate() method. Each entry in the list contains the following parameters:
[DOMString] name: The name of the checked file
[bool] ok: A flag indicating whether the file has passed validation
[DOMString] reason: An explanation for a failed validation