Player APIs (BrightScript & Ja...
...
Object Reference
Content Management Objects

roAssetPool

7min
an roassetpool instance represents a pool of files for synchronization you can instruct this object to populate the pool based on a sync spec and then realize it in a specified directory when required the javascript equivalent is assetpool docid\ ny8nhrk1 740wpryl p8d object creation the roassetpool object is created with a single parameter representing the rooted path of the pool createobject("roassetpool", pool path as string) example pool = createobject ("roassetpool", "sd /pool") ifassetpool getfailurereason() as string protectassets(name as string, collection as object) as boolean requests that the files specified in the "download" section of a sync spec receive a certain amount of protection specified files will not be deleted when the system software needs to reduce the size of the pool to make space unprotectassets(name as string) as boolean removes the protected status placed on the specified files by the protectassets() method asset collections are reference counted at the system software level as a result, when calling unprotectassets() , you must pass the same object that you previously passed to protectassets() unprotectallassets() as boolean removes the protected status placed on any files in the asset pool using the protectassets() method reservemegabytes(size as integer) as boolean reserves the specified amount of storage space this method is dynamic the system software attempts to keep the space free even when parallel processes are filling up the storage setmaximumpoolsizemegabytes(maximum size as integer) as boolean specifies the maximum size of an roassetpool instance in megabytes this method is more resource intensive than reservemegabytes() , but it is useful when creating multiple pools on a storage device getpoolsizeinmegabytes() as integer returns the current size of the asset pool (in megabytes) validate(sync spec as object, options as roassociativearray) as boolean checks the sha1, besha1, or md5 hash value of files that are in the sync spec and are currently present in the pool this method returns true if all checks pass and false if one or more checks fail calling getfailurereason() will return information about the corrupt file(s) note that a true return may not mean that all files in the sync spec are currently present in the pool the second parameter represents a table of validation options the key specifies the option and the value specifies whether the option is enabled or not (as a boolean value) currently, the only option is "deletecorrupt", which determines whether the method should automatically delete corrupt files or not queryfiles(sync spec as roassociativearray) as roassociativearray determines whether the specified files are present in the asset pool this method returns an associative array with filename keys and corresponding boolean values assetsready(collection as object) as boolean returns true if the specified files are ready in the asset pool