Discuss this help topic in SecureBlackbox Forum
Clouds: Delete folder
To delete a folder use one of two Delete() methods:
C#:
TElBoxFolder emptyFolder = storage.AcquireFolder(@"...");
Console.WriteLine("Folder: {0} (id = {1}, size = {2})",
emptyFolder.Name, emptyFolder.ID, emptyFolder.Size);
emptyFolder.Delete();
C#:
TElBoxFolder nonEmptyFolder = storage.AcquireFolder(@"...");
Console.WriteLine("Folder: {0} (id = {1}, size = {2})",
nonEmptyFolder.Name, nonEmptyFolder.ID, nonEmptyFolder.Size);
nonEmptyFolder.Delete(true);
As a result of successful execution of Delete() method the folder on the server will be moved to Trash, and the TElBoxFolder object will be destroyed, which means that after deletion of the folder you should not access properties or use methods of the object.
The attempt to call TElBoxDataStorage.AcquireFolder() with the ID of the deleted folder will cause EElBoxServerError exception with "trashed" code.
To obtain the object for the deleted folder call TElBoxDataStorage.AcquireTrashedFolder() method.