public class RealmMigrationNeededException
extends java.lang.RuntimeException
| Constructor and Description |
|---|
RealmMigrationNeededException(java.lang.String canonicalRealmPath,
java.lang.String detailMessage) |
RealmMigrationNeededException(java.lang.String canonicalRealmPath,
java.lang.String detailMessage,
java.lang.Throwable throwable) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getPath()
Returns the canonical path to the Realm file that needs to be migrated.
|
public RealmMigrationNeededException(java.lang.String canonicalRealmPath,
java.lang.String detailMessage)
public RealmMigrationNeededException(java.lang.String canonicalRealmPath,
java.lang.String detailMessage,
java.lang.Throwable throwable)
public java.lang.String getPath()
try {
Realm.getInstance(context);
} catch (RealmMigrationNeededException e) {
Realm.migrateRealmAtPath(e.getRealmPath(), new CustomMigration());
}
File.getCanonicalPath()