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: 5.1.2712
Syntax
public class WebDavSession : ISession, 
	IDisposable

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
Checks whether specified path 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 methodGetChildrenAsync
Enumerates children of the specified folder.
Public methodCode exampleGetFileAsync(String)
Returns IFile corresponding to path.
Public methodCode exampleGetFileAsync(Uri)
Returns IFile corresponding to path.
Public methodCode exampleGetFolderAsync(String)
Returns IFolder corresponding to path.
Public methodCode exampleGetFolderAsync(Uri)
Returns IFolder corresponding to path.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodCode exampleGetItemAsync(String)
Returns IHierarchyItem corresponding to path.
Public methodCode exampleGetItemAsync(Uri)
Returns IHierarchyItem corresponding to path.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodCode exampleGetVersionAsync(String)
Returns IVersion corresponding to path.
Public methodCode exampleGetVersionAsync(Uri)
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 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