Click or drag to resize

IHierarchyItemUnlockAsync Method (String, IDictionaryString, String, CancellationToken)

IT Hit WebDAV Classes Reference
Remove the locks.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 6.0.4052-Beta
Syntax
Task UnlockAsync(
	string lockToken,
	IDictionary<string, string> headers = null,
	CancellationToken cancellationToken = null
)

Parameters

lockToken
Type: SystemString
Identifies lock to be prolonged.
headers (Optional)
Type: System.Collections.GenericIDictionaryString, String
Request headers.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
Propagates notification that operations should be canceled.

Return Value

Type: Task

[Missing <returns> documentation for "M:ITHit.WebDAV.Client.IHierarchyItem.UnlockAsync(System.String,System.Collections.Generic.IDictionary{System.String,System.String},System.Threading.CancellationToken)"]

Exceptions
ExceptionCondition
PreconditionFailedExceptionThe item is not locked.
MethodNotAllowedExceptionThe item does not support locking.
NotFoundExceptionThe item doesn't exist on the server.
WebDavExceptionUnexpected error occurred.
Examples
string license = "<?xml version='1.0' encoding='utf...
WebDavSession session = new WebDavSession(license);
session.Credentials = new NetworkCredential("User1", "pwd");
IHierarchyItem item = await session.GetFileAsync(new Uri("https://server:8580/Products/Sales.txt"));
IFolder destFolder = await session.GetFolderAsync(new Uri("https://server:8580/Info/"));
LockInfo lockInfo = item.Lock(LockScope.Shared, false, "User 1", new TimeSpan(0, 20, 0));
item.CopyTo(destFolder, "Copy of " + item.DisplayName, false, false);
item.Unlock(lockInfo.LockToken.LockToken);
See Also