Namespace: ITHit.WebDAV.Client
[Missing <returns> documentation for "M:ITHit.WebDAV.Client.IHierarchyItemAsync.DeleteAsync(ITHit.WebDAV.Client.LockUriTokenPair[])"]
Exception | Condition |
---|---|
LockedException | This folder or any child item is locked and no or invalid lock token was specified. |
ForbiddenException | User has not enough rights to perform this operation. |
MethodNotAllowedException | Trying to delete lock-null item. Lock-null items must be deleted using UnlockAsync(String) method. |
WebDavHttpException | Server returned unknown error. |
WebDavException | Unexpected error occurred. |
IHierarchyItemAsync item = await session.OpenFolderAsync(new Uri("http://vova:8580/Sales/")); LockInfo lockInfo1 = await item.LockAsync(LockScope.Shared, true, "User 1", new TimeSpan(6, 0, 0)); IHierarchyItemAsync file = await session.OpenFileAsync(new Uri("http://vova:8580/Sales/Austria/report.docx")); LockInfo lockInfo2 = await file.LockAsync(LockScope.Shared, true, "User 1", new TimeSpan(6, 0, 0)); LockUriTokenPair[] locks = new LockUriTokenPair[2]; locks[0] = lockInfo1.LockToken; locks[1] = lockInfo2.LockToken; try { await item.DeleteAsync(locks); } catch (WebDavHttpException ex) { Console.WriteLine(ex.Message + " " + ex.Status.Code + " " + ex.Status.Description); foreach (IMultistatusResponseAsync resp in ex.Multistatus.Responses) { // Find which items failed to delete. Console.WriteLine(resp.Href + " " + resp.Status.Code + " " + resp.Status.Description); } }