Namespace: ITHit.WebDAV.Server.Class2
Exception | Condition |
---|---|
LockedException | This folder was locked. Client did not provide the lock token. |
NeedPrivilegesException | The user doesn't have enough privileges. |
InsufficientStorageException | Quota limit is reached. |
MultistatusException | Errors has occured during processing of the subtree. |
DavException | In other cases. |
If this lock included more than one hierarchy item, the lock is removed from all items included in the lock.
The code below is part of 'WebDAVServer.FileSystemStorage.AspNet' C# & VB samples provided with the SDK.
public async Task UnlockAsync(string lockToken) { if (string.IsNullOrEmpty(lockToken)) { throw new DavException("Lock can not be found.", DavStatus.BAD_REQUEST); } List<DateLockInfo> locks = await GetLocksAsync(getAllWithExpired: true); DateLockInfo lockInfo = locks.SingleOrDefault(x => x.LockToken == lockToken); await RemoveExpiredLocksAsync(lockToken); if (lockInfo == null || lockInfo.Expiration <= DateTime.UtcNow) { throw new DavException("The lock could not be found.", DavStatus.CONFLICT); } await context.socketService.NotifyUnLockedAsync(Path, GetWebSocketID()); }