Click or drag to resize
GDStorageFolderRenameAsync Method (String, NameCollisionOption)
Renames the current folder and specifies what to do if a folder with the same name already exists.

Namespace:  GD
Assembly:  GD (in GD.dll) Version: 255.255.255.255
Syntax
public IAsyncAction RenameAsync(
	string desiredName,
	NameCollisionOption option
)

Parameters

desiredName
Type: SystemString

The desired, new name for the current folder. This cannot be a path.

If there is an existing item in the current folder's location that already has the specified desiredName, the specified NameCollisionOption determines how BlackBerry Dynamics responds to the conflict.

option
Type: Windows.StorageNameCollisionOption
The enum value that determines how BlackBerry Dynamics responds if the desiredName is the same as the name of an existing item in the current folder's location.

Return Value

Type: IAsyncAction
No object or value is returned by this method when it completes.

Implements

IGDStorageItemRenameAsync(String, NameCollisionOption)
IGDStorageItemRenameAsync(String, NameCollisionOption)
Exceptions
ExceptionCondition
Exception Name you specify is invalid. To handle all the ways the specified name could be invalid, you must catch all of these exceptions:
E_FAIL
E_INVALIDARG
ERROR_FILENAME_EXCED_RANGE
ERROR_INVALID_NAME
ERROR_ALREADY_EXISTS
ERROR_FILE_NOT_FOUND
AccessDeniedException(C# equivalent: System.UnauthorizedAccessException) Secure storage was remotely wiped.
InvalidArgumentException(C# equivalent: System.ArgumentException) The name contains invalid characters, or the format of the path is incorrect. Check the value of desiredName.
Remarks

This method doesn't allow existing directory to be moved to different location.

If the file is deleted before the rename finishes, this method throws the ERROR_FILE_NOT_FOUND exception. You must also catch and handle this exception when you use this method.

ReplaceExisting does not exactly replace existing directory, but in fact it performs merge of existing directories. Existing sub-files with name collisions will be replaced during that process.

See Also