Fixes up some errors

This commit is contained in:
Shannon
2020-04-03 11:47:38 +11:00
parent 7e2d0902af
commit 4349115f0d
9 changed files with 34 additions and 17 deletions

View File

@@ -5,6 +5,19 @@ namespace Umbraco.Core.IO
{
public static class IOHelperExtensions
{
/// <summary>
/// Will resolve a virtual path URL to an absolute path, else if it is not a virtual path (i.e. starts with ~/) then
/// it will just return the path as-is (relative).
/// </summary>
/// <param name="ioHelper"></param>
/// <param name="path"></param>
/// <returns></returns>
public static string ResolveRelativeOrVirtualUrl(this IIOHelper ioHelper, string path)
{
if (string.IsNullOrWhiteSpace(path)) return path;
return path.StartsWith("~/") ? ioHelper.ResolveUrl(path) : path;
}
/// <summary>
/// Tries to create a directory.
/// </summary>