Assets

Methods
Assets.downloadData(String,QScriptValue)
Assets.getMapping(String,QScriptValue)
Assets.setMapping(String,String,QScriptValue)
Assets.uploadData(String,QScriptValue)

Methods

(static) downloadData(url, callback)

Download data from the connected domain's asset server.

Parameters:
Name Type Description
url string URL of asset to download, must be ATP scheme URL.
callback downloadDataCallback(data)

(static) getMapping(path, callback)

Look up a path to hash mapping within the connected domain's asset server

Parameters:
Name Type Description
path string
callback getMappingCallback(assetID, success)

(static) setMapping(path, hash, callback)

Sets up a path to hash mapping within the connected domain's asset server

Parameters:
Name Type Description
path string
hash string
callback setMappingCallback(error)

(static) uploadData(data, callback)

Upload content to the connected domain's asset server.

Parameters:
Name Type Description
data string content to upload
callback Assets~uploadDataCallback called when upload is complete

Type Definitions

downloadDataCallback(data)

Called when downloadData is complete

Parameters:
Name Type Description
data string content that was downloaded

getMappingCallback(assetID, success)

Called when getMapping is complete.

Parameters:
Name Type Description
assetID string hash value if found, else an empty string
success boolean false for errors other than "not found", else true

setMappingCallback(error)

Called when setMapping is complete

Parameters:
Name Type Description
error string

uploadDataCallback(url, hash)

Called when uploadData is complete

Parameters:
Name Type Description
url string
hash string