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 occurred during processing of the subtree. |
DavException | In other cases. |
The code below is part of 'WebDAVServer.NtfsStorage' sample provided with the SDK.
public RefreshLockResult RefreshLock(string token, TimeSpan? requestedTimeOut) { var explicitLocks = getExplicitLocks(); DateLockInfo li = explicitLocks.SingleOrDefault(l => l.LockToken == token); if (li == null) { throw new DavException("Lock can not be found.", DavStatus.PRECONDITION_FAILED); } if (requestedTimeOut.HasValue && requestedTimeOut != TimeSpan.MaxValue) { // Update timeout if it is specified and not Infinity. // Otherwise leave previous timeout. li.TimeOut = requestedTimeOut.Value; } if (!requestedTimeOut.HasValue) li.TimeOut = TimeSpan.FromMinutes(5); li.Expiration = DateTime.UtcNow + li.TimeOut; saveLocks(); return new RefreshLockResult(li.Level, li.IsDeep, li.TimeOut, li.ClientOwner); }