WebDav explorer [Beta]

This commit is contained in:
vfedosevich 2014-12-30 01:49:58 -08:00
parent 6c6b4b29a5
commit 3396e34c8e
27 changed files with 2119 additions and 1713 deletions

View file

@ -2,6 +2,7 @@ using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
@ -159,6 +160,8 @@ namespace WebsitePanel.WebDav.Core
request.Method = "PROPFIND";
request.ContentType = "application/xml";
request.Headers["Depth"] = "1";
//TODO Disable SSL
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; });
var credentials = (NetworkCredential) _credentials;
if (credentials != null && credentials.UserName != null)

View file

@ -73,11 +73,13 @@ namespace WebsitePanel.WebDav.Core
public Uri Href
{
get { return _href; }
set { SetHref(value.ToString(), new Uri(value.Scheme + "://" + value.Host + value.Segments[0] + value.Segments[1])); }
}
public ItemType ItemType
{
get { return _itemType; }
set { SetItemType(value); }
}
public DateTime LastModified

View file

@ -2,6 +2,7 @@
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Text;
using System.Text.RegularExpressions;
@ -122,6 +123,8 @@ namespace WebsitePanel.WebDav.Core
var webClient = new WebClient();
webClient.Credentials = credentials;
webClient.Headers.Add("Authorization", auth);
//TODO Disable SSL
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate{ return true; });
return webClient.OpenRead(_href);
}

View file

@ -11,7 +11,7 @@ namespace WebsitePanel.WebDav.Core
{
public class WebDavSession
{
public ICredentials Credentials { get; set; }
public NetworkCredential Credentials { get; set; }
/// <summary>
/// Returns IFolder corresponding to path.