Click or drag to resize

ILockGetActiveLocks Method

IT Hit WebDAV Classes Reference

Namespace: ITHit.WebDAV.Server.Class2
Assembly: ITHit.WebDAV.Server (in ITHit.WebDAV.Server.dll) Version: 4.5.3121.0
Syntax
IEnumerable<LockInfo> GetActiveLocks()

Return Value

Type: IEnumerableLockInfo
.
Exceptions
ExceptionCondition
NeedPrivilegesExceptionThe user doesn't have enough privileges.
DavExceptionIn other cases.
Remarks

This property must return all locks for the item including deep locks on any of the parent folders.

Examples

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

public IEnumerable<LockInfo> GetActiveLocks()
{
    var eplicitLocks = getExplicitLocks();
    return eplicitLocks.Select(
            l => new LockInfo
                 {
                     IsDeep = l.IsDeep,
                     Level = l.Level,
                     Owner = l.ClientOwner,
                     LockRoot = l.LockRoot,
                     TimeOut = l.Expiration == DateTime.MaxValue ?
                        TimeSpan.MaxValue :
                        l.Expiration - DateTime.UtcNow,
                     Token = l.LockToken
                 });
}
See Also