Click or drag to resize

WebDavSession Class

IT Hit WebDAV Classes Reference
Session for accessing WebDAV servers.
Inheritance Hierarchy
SystemObject
  ITHit.WebDAV.ClientWebDavSession

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 6.0.4052-Beta
Syntax
public class WebDavSession : ISession, 
	IDisposable

The WebDavSession type exposes the following members.

Properties
  NameDescription
Public propertyClientCertificates
Gets collection of certificates which will be attached to every request.
Public propertyContentEncoding
Gets or sets the HTTP character set of the output stream.
Public propertyCookieContainer
Cookies which will be added to all requests.
Public propertyCode exampleCredentials
Sets and gets credentials for connection.
Public propertyCustomHeaders
Custom user headers which will be added to all requests.
Public propertyExpect100Continue
Determines if header "Expect: 100-continue" will be sent with all request. Default value is true
Public propertyIIS6SSLSupport
Fixes urls for IIS 6 build-in WebDAV SSL connections.
Public propertyCode exampleTimeOut
Sets and gets time-out in milliseconds.
Top
Methods
  NameDescription
Public methodCreateFolderAsync
Creates a new folder.
Public methodDeleteAsync
Deletes an item.
Public methodDispose
Releases all resources used by the WebDavSession
Protected methodDispose(Boolean)
Releases the unmanaged resources used by the WebDavSession and optionally releases the managed resources
Public methodDownloadAsync
Loads a file or a part of the content of the file from WebDAV server.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodCode exampleExistsAsync(String, IDictionaryString, String, CancellationToken)
Checks whether specified path exists.
Public methodCode exampleExistsAsync(Uri, IDictionaryString, String, CancellationToken)
Checks whether specified uri exists.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetChangesAsync
Returns a list of changes that correspond to a synchronization request.
Public methodGetChildrenAsync
Enumerates children of the specified folder.
Public methodCode exampleGetFileAsync(String, IDictionaryString, String, CancellationToken)
Returns IFile corresponding to path.
Public methodCode exampleGetFileAsync(Uri, IDictionaryString, String, CancellationToken)
Returns IFile corresponding to path.
Public methodCode exampleGetFolderAsync(String, IDictionaryString, String, CancellationToken)
Returns IFolder corresponding to path.
Public methodCode exampleGetFolderAsync(Uri, IDictionaryString, String, CancellationToken)
Returns IFolder corresponding to path.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodCode exampleGetItemAsync(String, IDictionaryString, String, CancellationToken)
Returns IHierarchyItem corresponding to path.
Public methodCode exampleGetItemAsync(Uri, IDictionaryString, String, CancellationToken)
Returns IHierarchyItem corresponding to path.
Public methodGetItemAsync(Uri, PropertyName, IDictionaryString, String, CancellationToken)
Returns IHierarchyItem corresponding to path.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodCode exampleGetVersionAsync(String, IDictionaryString, String, CancellationToken)
Returns IVersion corresponding to path.
Public methodCode exampleGetVersionAsync(Uri, IDictionaryString, String, CancellationToken)
Returns IVersion corresponding to path.
Public methodLockAsync
Locks an item.
Public methodLogWebDavError(WebDavErrorEventArgs)
Rises the WebDavError event.
Public methodLogWebDavError(WebDavException)
Rises the WebDavError event.
Public methodLogWebDavMessage
Rises the WebDavMessage event.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMoveToAsync
Moves an item to a new location.
Protected methodOnWebDavError
Rises the WebDavError event.
Protected methodOnWebDavMessage
Rises the WebDavMessage event.
Public methodRefreshLockAsync
Prolongs the lock.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnlockAsync
Unlocks an item.
Public methodUploadAsync
Prepares a request to create or update a file.
Top
Events
  NameDescription
Public eventWebDavError
Event fired when any error occurs during the request. Fired before the library throws the exception.
Public eventWebDavMessage
Event fired when a new log data available during the request.
Top
Fields
  NameDescription
Public fieldClient
HTTP client used to send requests.
Top
Remarks
This class is intended to be instantiated once per application, rather than per-use.
Examples
string license = "<?xml version='1.0' encoding='utf...
WebDavSession session = new WebDavSession(license, new HttpClientHandler() { Credentials = new NetworkCredential("User1", "pwd")});

IFolder folder = null;
try
{
    folder = await session.GetFolderAsync(new Uri("https://server:8080/Products"));
}
catch(UnauthorizedException)
{
    Console.WriteLine("Incorrect user name or password.");
}
catch(NotFoundException)
{
    Console.WriteLine("Folder not found.");
}

if(folder!=null)
{
    Console.WriteLine(folder.LastModified.ToString());
}
See Also