Class AssetController
-
- All Implemented Interfaces:
public class AssetController extends AssetDelegate
-
-
Field Summary
Fields Modifier and Type Field Description public Stringpathpublic booleanisUpdateLockedpublic StringreportingValuespublic StringschemaPath
-
Constructor Summary
Constructors Constructor Description AssetController(Context context, String assetPath)
-
Method Summary
Modifier and Type Method Description booleanisUpdateLocked()StringgetReportingValues()voidsetReportingValues(String reportingValues)StringgetSchemaPath()voidsetupAssetUpdate(AssetContext assetContext, IAssetDelegate callback)Sets up the AssetController with a context to the Trainer project and a delegate to handle callbacks. voidlockUpdate()voidresetAssetUpdate()Resets the asset update functionality. voidcreateBackup()Creates a backup of the current assets voidrestoreBackup()Restores assets from a backup if it exists booleandeleteBackup()Deletes the backup folder StringgetPath()Gets the asset path voidsetPath(String path)Sets the asset path List<String>getAssetFiles()* Gets a list of all local assets that have been stored for this project. StringgetAssetVersion()Gets the asset version booleanareLocalAssetsAvailable()* Returns true if local assets are available. booleanisActive()* Returns true if the AssetController if 'SetupAssetUpdate' was called. voidcheckForUpdates()Checks whether asset updates are available voidupdateAssets()Updates the assets, only after checkForUpdates was successfully called voidcancelUpdate()Cancel an ongoing update StringgetAssetId()booleandeleteLocalAssets()Delete the local assets voidonAssetDownloadProgress(String assetName, float progress)voidonAssetUpdateAvailable(boolean updateAvailable)voidonAssetUpdateError(String error)voidonAssetUpdateFinished()-
-
Method Detail
-
isUpdateLocked
boolean isUpdateLocked()
-
getReportingValues
String getReportingValues()
-
setReportingValues
void setReportingValues(String reportingValues)
-
getSchemaPath
String getSchemaPath()
-
setupAssetUpdate
void setupAssetUpdate(AssetContext assetContext, IAssetDelegate callback)
Sets up the AssetController with a context to the Trainer project and a delegate to handle callbacks. After this method is called, the AssetController is considered 'active'.
- Parameters:
assetContext- The contextcallback- The callback
-
lockUpdate
void lockUpdate()
-
resetAssetUpdate
void resetAssetUpdate()
Resets the asset update functionality. After this is called, setupAssetUpdate must be called again
-
createBackup
void createBackup()
Creates a backup of the current assets
-
restoreBackup
void restoreBackup()
Restores assets from a backup if it exists
-
deleteBackup
boolean deleteBackup()
Deletes the backup folder
- Returns:
success of the function
-
getAssetFiles
List<String> getAssetFiles()
* Gets a list of all local assets that have been stored for this project.
-
getAssetVersion
String getAssetVersion()
Gets the asset version
- Returns:
asset version
-
areLocalAssetsAvailable
boolean areLocalAssetsAvailable()
* Returns true if local assets are available.
-
isActive
boolean isActive()
* Returns true if the AssetController if 'SetupAssetUpdate' was called. Returns false if 'ResetAssetUpdate' was called or 'SetupAssetUpdate' has not been called.
-
checkForUpdates
void checkForUpdates()
Checks whether asset updates are available
-
updateAssets
void updateAssets()
Updates the assets, only after checkForUpdates was successfully called
-
cancelUpdate
void cancelUpdate()
Cancel an ongoing update
-
getAssetId
String getAssetId()
-
deleteLocalAssets
boolean deleteLocalAssets()
Delete the local assets
-
onAssetDownloadProgress
void onAssetDownloadProgress(String assetName, float progress)
-
onAssetUpdateAvailable
void onAssetUpdateAvailable(boolean updateAvailable)
-
onAssetUpdateError
void onAssetUpdateError(String error)
-
onAssetUpdateFinished
void onAssetUpdateFinished()
-
-
-
-