Android.App.Backup.BackupAgent.OnRestoreFile Method
Handle the data delivered via the given file descriptor during a full restore operation.

Syntax

[Android.Runtime.Register("onRestoreFile", "(Landroid/os/ParcelFileDescriptor;JLjava/io/File;IJJ)V", "GetOnRestoreFile_Landroid_os_ParcelFileDescriptor_JLjava_io_File_IJJHandler")]
public virtual void OnRestoreFile (Android.OS.ParcelFileDescriptor data, long size, Java.IO.File destination, [Android.Runtime.GeneratedEnum] BackupFileType type, long mode, long mtime)

Parameters

data
A read-only file descriptor from which the agent can read size bytes of file data.
size
The number of bytes of file content to be restored to the given destination. If the file system object being restored is a directory, size will be zero.
destination
The File on disk to be restored with the given data.
type
The kind of file system object being restored. This will be either BackupAgent.TypeFile or BackupAgent.TypeDirectory.
mode
The access mode to be assigned to the destination after its data is written. This is in the standard format used by chmod().
mtime
The modification time of the file when it was backed up, suitable to be assigned to the file after its data is written.

Exceptions

TypeReason
Java.IO.IOException

Remarks

Handle the data delivered via the given file descriptor during a full restore operation. The agent is given the path to the file's original location as well as its size and metadata.

The file descriptor can only be read for size bytes; attempting to read more data has undefined behavior.

The default implementation creates the destination file/directory and populates it with the data from the file descriptor, then sets the file's access mode and modification time to match the restore arguments.

[Android Documentation]

Requirements

Namespace: Android.App.Backup
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 14