Interface DynamicBackup

All Known Implementing Classes:
DynamicBackupFragment

public interface DynamicBackup
Interface to listen various backup events.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the backup directory for the app storage.
    Returns the extension for the backup file.
    Returns the mime type to import the backup file.
    int
    This method will be called to get the selected backup location.
    Returns the mime type for the backup file.
    getBackupTask(String backup, int location)
    This method will be called to get the backup task.
    getRestoreTask(File backup, boolean delete)
    This method will be called to get the restore task.
    boolean
    isBackupExist(String backupName, int location)
    This method will be called to check if the backup exits for the supplied name.
    void
    onAllBackupsDeleted(boolean deleted)
    This method will be called after deleting all the backups stored in the app storage.
    void
    onBackupCreated(File backup, int location)
    This method will be called when a backup is created.
    void
    This method will be called after deleting a backup.
    void
    onBackupError(File file, int location)
    This method will be called if there is any error while doing the backup operations.
    void
    onBackupRenamed(File backup, String newName, boolean renamed)
    This method will be called after renaming the backup.
    void
    onBackupSaved(Uri backup, int location)
    This method will be called when a backup is saved.
    void
    onBackupSaved(File backup, int location)
    This method will be called when a backup is saved.
    void
    onCreateBackup(String backup, int location)
    This method will be called on creating the backup.
    void
    This method will be called on deleting all the backups stored in the app storage.
    void
    onDeleteAllBackups(boolean delete)
    This method will be called on deleting all the backups stored in the app storage.
    void
    onDeleteBackup(File backup, boolean delete)
    This method will be called on deleting the backup.
    void
    This method will be called on requesting the backup from device storage.
    void
    This method will be called on importing the backup from device storage.
    void
    This method will be called on refreshing the backup state.
    void
    onRenameBackup(File backup, String newName)
    This method will be called on renaming the backup.
    void
    This method will be called on restoring a backup.
    void
    onRestoreBackup(File backup, boolean delete)
    This method will be called on restoring a backup.
    void
    This method will be called after completing the restore process.
    void
    This method will be called if there is any error while doing the restore operations.
    void
    onSetProgress(BackupConfig backupConfig, boolean visible)
    This method will be called to set the backup progress.
    void
    This method will be called on sharing the backup.
    boolean
    This method will be to verify the selected backup.
    boolean
    This method will be to verify the selected backup.
    void
    setBackupLocation(int location)
    This method will be called to save the selected backup location.
    void
    showBackupDialog(int type)
    This method will be called to show the backup dialog.
  • Method Details

    • getBackupMime

      @NonNull String getBackupMime()
      Returns the mime type for the backup file.
      Returns:
      The mime type for the backup file.
    • getBackupImportMime

      @NonNull String getBackupImportMime()
      Returns the mime type to import the backup file.
      Returns:
      The mime type to import the backup file.
    • getBackupExtension

      @NonNull String getBackupExtension()
      Returns the extension for the backup file.
      Returns:
      The extension for the backup file.
    • getBackupDir

      @Nullable String getBackupDir()
      Returns the backup directory for the app storage.
      Returns:
      The backup directory for the app storage.
    • showBackupDialog

      void showBackupDialog(int type)
      This method will be called to show the backup dialog.
      Parameters:
      type - The dialog type to be set.
    • getBackupLocation

      int getBackupLocation()
      This method will be called to get the selected backup location.
      Returns:
      The selected backup location.
    • setBackupLocation

      void setBackupLocation(int location)
      This method will be called to save the selected backup location.
      Parameters:
      location - The backup location to be set.
    • isBackupExist

      boolean isBackupExist(@Nullable String backupName, int location)
      This method will be called to check if the backup exits for the supplied name.
      Parameters:
      backupName - The backup name to be checked.
      location - The backup location to be used.
      Returns:
      true if the backup exits for the supplied name.
    • onCreateBackup

      void onCreateBackup(@NonNull String backup, int location)
      This method will be called on creating the backup.
      Parameters:
      backup - The requested backup name.
      location - The requested backup location.
    • getBackupTask

      @Nullable DynamicTask<?,?,File> getBackupTask(@NonNull String backup, int location)
      This method will be called to get the backup task.
      Parameters:
      backup - The requested backup name.
      location - The requested backup location.
      Returns:
      The DynamicTask to create the backup.
    • onBackupCreated

      void onBackupCreated(@Nullable File backup, int location)
      This method will be called when a backup is created.
      Parameters:
      backup - The created backup file.
      location - The requested backup location.
    • onSetProgress

      void onSetProgress(@Nullable BackupConfig backupConfig, boolean visible)
      This method will be called to set the backup progress.
      Parameters:
      backupConfig - The backup configurations.
      visible - true to make the progress visible.
    • onBackupSaved

      void onBackupSaved(@Nullable File backup, int location)
      This method will be called when a backup is saved.
      Parameters:
      backup - The saved backup file.
      location - The requested backup location.
    • onBackupSaved

      void onBackupSaved(@Nullable Uri backup, int location)
      This method will be called when a backup is saved.
      Parameters:
      backup - The saved backup file URI.
      location - The requested backup location.
    • onShareBackup

      void onShareBackup(@Nullable File backup)
      This method will be called on sharing the backup.
      Parameters:
      backup - The created backup file.
    • onRenameBackup

      void onRenameBackup(@NonNull File backup, @NonNull String newName)
      This method will be called on renaming the backup.
      Parameters:
      backup - The backup file to be renamed.
      newName - The new name for the backup file.
    • onBackupRenamed

      void onBackupRenamed(@Nullable File backup, @Nullable String newName, boolean renamed)
      This method will be called after renaming the backup.
      Parameters:
      backup - The renamed backup file to.
      newName - The new name of the backup file.
      renamed - true if the backup is renamed successfully.
    • onDeleteBackup

      void onDeleteBackup(@Nullable File backup, boolean delete)
      This method will be called on deleting the backup.
      Parameters:
      backup - The backup file to be deleted.
      delete - true to delete the backup.
    • onBackupDeleted

      void onBackupDeleted(@Nullable String backup)
      This method will be called after deleting a backup.
      Parameters:
      backup - The deleted backup name.
    • onDeleteAllBackups

      void onDeleteAllBackups()
      This method will be called on deleting all the backups stored in the app storage.
    • onDeleteAllBackups

      void onDeleteAllBackups(boolean delete)
      This method will be called on deleting all the backups stored in the app storage.
      Parameters:
      delete - true to delete all the backups.
    • onAllBackupsDeleted

      void onAllBackupsDeleted(boolean deleted)
      This method will be called after deleting all the backups stored in the app storage.
      Parameters:
      deleted - true if the operation has been completed successfully.
    • onVerifyBackup

      boolean onVerifyBackup(@NonNull Uri backup)
      This method will be to verify the selected backup.
      Parameters:
      backup - The backup URI to be verified.
      Returns:
      true if the backup has been verified successfully.
    • onVerifyBackup

      boolean onVerifyBackup(@NonNull File backup)
      This method will be to verify the selected backup.
      Parameters:
      backup - The backup file to be verified.
      Returns:
      true if the backup has been verified successfully.
    • onRestoreBackup

      void onRestoreBackup(@NonNull File backup)
      This method will be called on restoring a backup.
      Parameters:
      backup - The backup file to be restored.
    • onRestoreBackup

      void onRestoreBackup(@NonNull File backup, boolean delete)
      This method will be called on restoring a backup.
      Parameters:
      backup - The backup file to be restored.
      delete - true to delete the backup file after performing the restore operation.
    • getRestoreTask

      @Nullable DynamicTask<?,?,Boolean> getRestoreTask(@NonNull File backup, boolean delete)
      This method will be called to get the restore task.
      Parameters:
      backup - The backup file to be restored.
      delete - true to delete the backup file after performing the restore operation.
      Returns:
      The DynamicTask to create the backup.
    • onRestoreComplete

      void onRestoreComplete(@NonNull File backup)
      This method will be called after completing the restore process.
      Parameters:
      backup - The restored backup file.
    • onImportBackup

      void onImportBackup()
      This method will be called on requesting the backup from device storage.
    • onImportBackup

      void onImportBackup(@Nullable Uri uri)
      This method will be called on importing the backup from device storage.
      Parameters:
      uri - The backup file URI to be imported.
    • onBackupError

      void onBackupError(@Nullable File file, int location)
      This method will be called if there is any error while doing the backup operations.
      Parameters:
      file - The erroneous backup file.
      location - The requested backup location.
    • onRestoreError

      void onRestoreError(@Nullable File file)
      This method will be called if there is any error while doing the restore operations.
      Parameters:
      file - The erroneous restore file.
    • onRefresh

      void onRefresh()
      This method will be called on refreshing the backup state.