android-components / mozilla.components.support.migration / FennecMigrator

FennecMigrator

class FennecMigrator (source)

Entrypoint for Fennec data migration. See Builder for public API.

Parameters

context - Application context used for accessing the file system.

migrations - Describes ordering and versioning of migrations to run.

historyStorage - An optional instance of PlacesHistoryStorage used to store migrated history data.

bookmarksStorage - An optional instance of PlacesBookmarksStorage used to store migrated bookmarks data.

coroutineContext - An instance of CoroutineContext used for executing async migration tasks.

Types

Name Summary
Builder class Builder
Data migration builder. Allows configuring which migrations to run, their versions and relative order.

Functions

Name Summary
migrateAsync fun migrateAsync(store: MigrationStore): Deferred<MigrationResults>
Performs configured data migration. See Builder for how to configure a data migration.
startMigrationIfNeeded fun <T : AbstractMigrationService> startMigrationIfNeeded(store: MigrationStore, service: Class<T>): Unit
If a migration is needed then invoking this method will update the MigrationStore and launch the provided AbstractMigrationService implementation.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.