AbsoluteFileBackupHelperpublic class AbsoluteFileBackupHelper extends FileBackupHelperBase implements BackupHelperLike FileBackupHelper, but takes absolute paths for the files instead of
subpaths of getFilesDir() |
Fields Summary |
---|
private static final String | TAG | private static final boolean | DEBUG | android.content.Context | mContext | String[] | mFiles |
Constructors Summary |
---|
public AbsoluteFileBackupHelper(android.content.Context context, String files)Construct a helper for backing up / restoring the files at the given absolute locations
within the file system.
super(context);
mContext = context;
mFiles = files;
|
Methods Summary |
---|
public void | performBackup(android.os.ParcelFileDescriptor oldState, BackupDataOutput data, android.os.ParcelFileDescriptor newState)Based on oldState, determine which of the files from the application's data directory
need to be backed up, write them to the data stream, and fill in newState with the
state as it exists now.
// use the file paths as the keys, too
performBackup_checked(oldState, data, newState, mFiles, mFiles);
| public void | restoreEntity(BackupDataInputStream data)Restore one absolute file entity from the restore stream
if (DEBUG) Log.d(TAG, "got entity '" + data.getKey() + "' size=" + data.size());
String key = data.getKey();
if (isKeyInList(key, mFiles)) {
File f = new File(key);
writeFile(f, data);
}
|
|