Precondition failed.
For a list of all members of this type, see PreconditionFailedException Members.
System.Object
System.Exception
ITHit.WebDAV.Client.Exceptions.WebDavException
ITHit.WebDAV.Client.Exceptions.WebDavHttpException
ITHit.WebDAV.Client.Exceptions.PreconditionFailedException
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
Thrown when server responded with 412 (Precondition Failed) http response. The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server. This response code allows the client to place preconditions on the current resource metainformation (header field data) and thus prevent the requested method from being applied to a resource other than the one intended.
IFolder itemSrc = session.OpenFolder(new Uri("http://server:8080/Library/"));
IFolder itemDst = session.OpenFolder(new Uri("http://server:8080/Sales/"));
try
{
itemSrc.MoveTo(itemDst, itemSrc.DisplayName, false);
}
catch (PreconditionFailedException)
{
Console.WriteLine("The destination item exists and 'overwrite' was 'false'.");
}
catch (WebDavHttpException ex)
{
Console.WriteLine(ex.Message + " " + ex.Status.Code + " " + ex.Status.Description);
foreach (IMultistatusResponse resp in ex.Multistatus.Responses)
{ // Find which items failed to move.
Console.WriteLine(resp.Href + " " + resp.Status.Code + " " + resp.Status.Description);
}
}
Namespace: ITHit.WebDAV.Client.Exceptions
Assembly: ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll)
PreconditionFailedException Members | ITHit.WebDAV.Client.Exceptions Namespace