Interface DynamicBackup
- All Known Implementing Classes:
DynamicBackupFragment
public interface DynamicBackup
Interface to listen various backup events.
-
Method Summary
Modifier and TypeMethodDescriptionReturns 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.DynamicTask<?,
?, File> getBackupTask
(String backup, int location) This method will be called to get the backup task.DynamicTask<?,
?, Boolean> 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
onBackupDeleted
(String backup) 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
onImportBackup
(Uri uri) 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
onRestoreBackup
(File backup) 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
onRestoreComplete
(File backup) This method will be called after completing the restore process.void
onRestoreError
(File file) 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
onShareBackup
(File backup) This method will be called on sharing the backup.boolean
onVerifyBackup
(Uri backup) This method will be to verify the selected backup.boolean
onVerifyBackup
(File backup) 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
Returns the mime type for the backup file.- Returns:
- The mime type for the backup file.
-
getBackupImportMime
Returns the mime type to import the backup file.- Returns:
- The mime type to import the backup file.
-
getBackupExtension
Returns the extension for the backup file.- Returns:
- The extension for the backup file.
-
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
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
This method will be called on creating the backup.- Parameters:
backup
- The requested backup name.location
- The requested backup location.
-
getBackupTask
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
This method will be called when a backup is created.- Parameters:
backup
- The created backup file.location
- The requested backup location.
-
onBackupSaved
This method will be called when a backup is saved.- Parameters:
backup
- The saved backup file.location
- The requested backup location.
-
onBackupSaved
This method will be called when a backup is saved.- Parameters:
backup
- The saved backup file URI.location
- The requested backup location.
-
onRenameBackup
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
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
This method will be called on deleting the backup.- Parameters:
backup
- The backup file to be deleted.delete
-true
to delete the backup.
-
onBackupDeleted
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
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
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
This method will be called on restoring a backup.- Parameters:
backup
- The backup file to be restored.
-
onRestoreBackup
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
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
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
This method will be called on importing the backup from device storage.- Parameters:
uri
- The backup file URI to be imported.
-
onBackupError
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
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.
-