6.1-roAssetRealizer

ON THIS PAGE


This object contains functions for realizing files.

Object Creation: The roAssetRealizer object requires two parameters upon creation: an roAssetPool object and a destination directory.

CreateObject("roAssetRealizer", pool As roAssetPool, destination_directory As String)
Example
pool = CreateObject("roAssetPool", "pool")
realizer = CreateObject ("roAssetRealizer", pool, "/")

IfUserData

SetUserData(user_data As Object)

Sets the user data that will be returned when events are raised.

GetUserData() As Object

Returns the user data that has previously been set via SetUserData(). It will return Invalid if no data has been set.

ifAssetRealizer

GetFailureReason() As String

Yields additional useful information if a function return indicates an error.

EstimateRealizedSizeInMegabytes(spec As Object) As Integer

Returns the estimated amount of space that would be taken up by the specified sync spec.

Realize(spec As roSyncSpec/roAssetCollection) As Object

Places the files into the destination directory specified in the passed roSyncSpec or roAssetCollection. If the pool does not contain the full set of required files, then this method will immediately fail before any files are changed (this method will always attempt to do as much work as possible before destructively modifying the file system). This method automatically checks the length of the file and any hashes that match the specification. If there is a mistmatch, then the affected file is deleted and realization fails. This method indicates success or failure by returning an roAssetRealizerEvent object.

Note

The pool and the destination must be in the same file system.

ValidateFiles(spec As Object, options As Object) As Object

Checks the hash of every file in the spec against the corresponding file in the destination path and returns an associative array containing each mismatched fle name mapped to the reason. The options parameter is an roAssociativeArray, which can currently support a single option:

  • "DeleteCorrupt": Automatically deletes any files that do not match the expected hash. By default, these hashes are not deleted.