OS independent file paths

This commit is contained in:
Sean Long
2020-04-17 16:25:00 -04:00
parent 2dd2216aa2
commit 70502cd881
13 changed files with 41 additions and 36 deletions

View File

@ -9,6 +9,7 @@ using Oqtane.Enums;
using Oqtane.Infrastructure;
using Oqtane.Repository;
using Oqtane.Security;
using System.IO;
namespace Oqtane.Controllers
{
@ -109,7 +110,7 @@ namespace Oqtane.Controllers
if (string.IsNullOrEmpty(folder.Path) && folder.ParentId != null)
{
Folder parent = _folders.GetFolder(folder.ParentId.Value);
folder.Path = parent.Path + folder.Name + "\\";
folder.Path = Path.Combine(parent.Path, folder.Name);
}
folder = _folders.AddFolder(folder);
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Folder Added {Folder}", folder);
@ -134,7 +135,7 @@ namespace Oqtane.Controllers
if (string.IsNullOrEmpty(folder.Path) && folder.ParentId != null)
{
Folder parent = _folders.GetFolder(folder.ParentId.Value);
folder.Path = parent.Path + folder.Name + "\\";
folder.Path = Path.Combine(parent.Path, folder.Name);
}
folder = _folders.UpdateFolder(folder);
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Folder Updated {Folder}", folder);