webdav portal fixes
This commit is contained in:
parent
a4cb95e2db
commit
0a64381dac
10 changed files with 161 additions and 5 deletions
|
@ -9,5 +9,13 @@ namespace WebsitePanel.WebDav.Core.Extensions
|
|||
{
|
||||
return new Uri(paths.Aggregate(uri.AbsoluteUri, (current, path) => string.Format("{0}/{1}", current.TrimEnd('/'), path.TrimStart('/'))));
|
||||
}
|
||||
|
||||
public static string ToStringPath(this Uri uri)
|
||||
{
|
||||
var hostStart = uri.ToString().IndexOf(uri.Host, System.StringComparison.Ordinal);
|
||||
var hostLength = uri.Host.Length;
|
||||
|
||||
return uri.ToString().Substring(hostStart + hostLength, uri.ToString().Length - hostStart - hostLength);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -483,7 +483,7 @@ namespace WebsitePanel.WebDav.Core
|
|||
{
|
||||
_href = href;
|
||||
|
||||
var baseUrl = href.AbsoluteUri.Remove(href.AbsoluteUri.Length - href.Segments.Last().Length);
|
||||
var baseUrl = href.ToString().Remove(href.ToString().Length - href.ToString().Trim('/').Split('/').Last().Length);
|
||||
|
||||
_baseUri = new Uri(baseUrl);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace WebsitePanel.WebDav.Core.Managers
|
|||
Href = new Uri(x.Url),
|
||||
ItemType = ItemType.Folder,
|
||||
ContentLength = x.Size * 1024 * 1024,
|
||||
AllocatedSpace = x.FRSMQuotaMB * 1024 * 1024,
|
||||
AllocatedSpace = (long)x.FRSMQuotaMB * 1024 * 1024,
|
||||
IsRootItem = true
|
||||
}).ToArray();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue