Skip to main content

TdxCloudStorage.MoveItemToTrash(TdxCloudStorageItem) Method

Moves the specified cloud file or folder to the “Trash” special folder.

Declaration

procedure MoveItemToTrash(AItem: TdxCloudStorageItem);

Parameters

Name Type Description
AItem TdxCloudStorageItem

A metadata container that corresponds to the target file or folder.

Remarks

This procedure moves every nested file and folder at all nesting levels to the trash if the specified cloud storage item is a non-empty folder. The trash operation can take a noticeable amount of time depending on the total resource count. If the target resource is already within the “Trash” folder (that is, the specified item’s Trashed property returns True), a MoveToTrash procedure call has no effect.

A MoveToTrash procedure call raises an exception if the specified online resource does not support this operation. For instance, you cannot place a special or root folder in the “Trash” folder.

Note

The MoveToTrash procedure always runs in the same thread from which it was invoked. A single MoveToTrash procedure call sends only a single resource trash operation request to the connected cloud file storage’s server regardless of the nested resource count if the trashed resource is a non-empty folder. The cloud storage component raises the OnItemMovedToTrash event for every successful file or folder trash request. If a MoveToTrash procedure call results in an error, the OnError event occurs instead.

See Also