6.1-roAssetPool
ON THIS PAGE
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.Â
Object Creation: The roAssetPool object is created with a single parameter representing the rooted path of the pool.
CreateObject("roAssetPool", pool_path As String)
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
Â
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
Â
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.