Class ClientResetRequiredError

    • Method Detail

      • executeClientReset

        public void executeClientReset()
        Calling this method will execute the Client Reset manually instead of waiting until next app restart. This will only be possible if all instances of that Realm have been closed, otherwise a IllegalStateException will be thrown.

        After this method returns, the backup file can be found in the location returned by getBackupFile(). The file at getOriginalFile() have been deleted, but will be recreated from scratch next time a Realm instance is opened.

        Throws:
        IllegalStateException - if not all instances have been closed.
      • getBackupFile

        public File getBackupFile()
        Returns the location of the backed up Realm file. The file will not be present until the Client Reset has been fully executed.
        Returns:
        a reference to the location of the backup file once Client Reset has been executed. Use file.exists() to check if the file exists or not.
      • getBackupRealmConfiguration

        public RealmConfiguration getBackupRealmConfiguration()
        The configuration that can be used to open the backup Realm offline. This configuration can only be used in combination with a DynamicRealm.
        Returns:
        the configuration that can be used to open the backup Realm offline.
      • getOriginalFile

        public File getOriginalFile()
        Returns the location of the original Realm file. After the Client Reset has completed, the file at this location will be deleted.
        Returns:
        a reference to the location of the original Realm file. After Client Reset has been executed this file will no longer exists. Use file.exists() to check this.