Released windows auth, connect to ES.Services.

This commit is contained in:
ITRANSITION\e.revyakin 2014-12-03 11:43:26 +03:00
parent 2569e55609
commit d29c347ff4
294 changed files with 329583 additions and 2315 deletions

View file

@ -0,0 +1,64 @@
using System;
using System.Net;
namespace WebsitePanel.WebDav.Core
{
/// <summary>
/// WebDav.Client Namespace.
/// </summary>
/// <see cref="http://doc.webdavsystem.com/ITHit.WebDAV.Client.html"/>
namespace Client
{
public class WebDavSession
{
public ICredentials Credentials { get; set; }
/// <summary>
/// Returns IFolder corresponding to path.
/// </summary>
/// <param name="path">Path to the folder.</param>
/// <returns>Folder corresponding to requested path.</returns>
public IFolder OpenFolder(string path)
{
var folder = new WebDavFolder();
folder.SetCredentials(Credentials);
folder.Open(path);
return folder;
}
/// <summary>
/// Returns IFolder corresponding to path.
/// </summary>
/// <param name="path">Path to the folder.</param>
/// <returns>Folder corresponding to requested path.</returns>
public IFolder OpenFolder(Uri path)
{
var folder = new WebDavFolder();
folder.SetCredentials(Credentials);
folder.Open(path);
return folder;
}
/// <summary>
/// Returns IResource corresponding to path.
/// </summary>
/// <param name="path">Path to the resource.</param>
/// <returns>Resource corresponding to requested path.</returns>
public IResource OpenResource(string path)
{
return OpenResource(new Uri(path));
}
/// <summary>
/// Returns IResource corresponding to path.
/// </summary>
/// <param name="path">Path to the resource.</param>
/// <returns>Resource corresponding to requested path.</returns>
public IResource OpenResource(Uri path)
{
IFolder folder = OpenFolder(path);
return folder.GetResource(path.Segments[path.Segments.Length - 1]);
}
}
}
}