Click or drag to resize

ILockUnlock Method

IT Hit WebDAV Classes Reference
Removes lock with the specified token from this item.

Namespace: ITHit.WebDAV.Server.Class2
Assembly: ITHit.WebDAV.Server (in ITHit.WebDAV.Server.dll) Version: 4.5.3121.0
Syntax
void Unlock(
	string lockToken
)

Parameters

lockToken
Type: SystemString
Lock with this token should be removed from the item.

Return Value

Type: 
.
Exceptions
ExceptionCondition
LockedExceptionThis folder was locked. Client did not provide the lock token.
NeedPrivilegesExceptionThe user doesn't have enough privileges.
InsufficientStorageExceptionQuota limit is reached.
MultistatusExceptionErrors has occured during processing of the subtree.
DavExceptionIn other cases.
Remarks

If this lock included more than one hierarchy item, the lock is removed from all items included in the lock.

Examples

The code below is part of 'WebDAVServer.NtfsStorage' sample provided with the SDK.

public void Unlock(string lockToken)
{
    var explicitLocks = getExplicitLocks();
    int i = explicitLocks.FindIndex(li => li.LockToken == lockToken);
    if (i >= 0)
    {
        explicitLocks.RemoveAt(i);
    }
    else
    {
        throw new DavException("The lock could not be found.", DavStatus.PRECONDITION_FAILED);
    }

    saveLocks();
}
See Also