Created
May 8, 2020 18:06
-
-
Save varundwarkani/2d39dba4d141f0a73b0e734f41ed3eff to your computer and use it in GitHub Desktop.
To delete the temporary backup file after restore operation is successful.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void deleteRestoreBackupFile(Context context) { | |
File directory = new File(getFilePath(context, 0), "backup"); | |
String sfpath = directory.getPath() + File.separator + BACKUP_RESTORE_ROLLBACK_FILE_NAME; | |
//This is to prevent deleting extra file being deleted which is mentioned in previous comment lines. | |
File restoreFile = new File(sfpath); | |
if (restoreFile.exists()) { | |
restoreFile.delete(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment