Click or drag to resize
GDStorageFileMoveToSecureStorageAsync Method (IStorageFile, IGDStorageFolder, String)
Moves external file to BlackBerry Dynamics secure storage and changes name of moved file.

Namespace:  GD
Assembly:  GD (in GD.dll) Version: 255.255.255.255
Syntax
public static IAsyncOperation<GDStorageFile> MoveToSecureStorageAsync(
	IStorageFile file,
	IGDStorageFolder destinationFolder,
	string desiredNewName
)

Parameters

file
Type: Windows.StorageIStorageFile
External file to be moved.
destinationFolder
Type: GDIGDStorageFolder
Folder from BlackBerry Dynamics secure storage where file will be moved.
desiredNewName
Type: SystemString
The desired name of the file in the SDK secure folder.

Return Value

Type: IAsyncOperationGDStorageFile
When this method completes, it returns a GDStorageFile that represents moved file to secure storage.
Exceptions
ExceptionCondition
ExceptionA file with the specified desiredName already exists in the current folder or some unexpected error occurred.
AccessDeniedExceptionSecure storage was remotely wiped.
InvalidArgumentExceptionThe format of the filename is incorrect. Check the value of desiredName.
Remarks

When this method completes it tries to zero-out and then delete an original file. If for some reason application could not get write access to file stream it will just copy (not move) the file to secure storage.

This method uses the FailIfExists value from the NameCollisionOption enumeration by default. That is, this method raises an exception if a file with the same name already exists in the destination folder. If you want to handle a file name collision in a different way, call the MoveToSecureStorageAsync(IStorageFile, IGDStorageFolder, String, NameCollisionOption) method.

See Also