diff --git a/ICD.Common.Utils/IO/IcdPath.cs b/ICD.Common.Utils/IO/IcdPath.cs index b1946bf..ec7a9b7 100644 --- a/ICD.Common.Utils/IO/IcdPath.cs +++ b/ICD.Common.Utils/IO/IcdPath.cs @@ -1,5 +1,6 @@ using System; using ICD.Common.Properties; +using ICD.Common.Utils.Extensions; #if SIMPLSHARP using Crestron.SimplSharp.CrestronIO; #else @@ -69,16 +70,16 @@ namespace ICD.Common.Utils.IO return Path.ChangeExtension(path, ext); } - public static string GetRelativePath(string folder, string filespec) - { - Uri pathUri = new Uri(filespec); - // Folders must end in a slash - if (!folder.EndsWith(Path.DirectorySeparatorChar.ToString())) - { - folder += Path.DirectorySeparatorChar; - } - Uri folderUri = new Uri(folder); - return Uri.UnescapeDataString(folderUri.MakeRelativeUri(pathUri).ToString().Replace('/', Path.DirectorySeparatorChar)); - } + public static string GetRelativePath(string folder, string filespec) + { + Uri pathUri = new Uri(filespec); + + // Folders must end in a slash + if (!folder.EndsWith(Path.DirectorySeparatorChar)) + folder += Path.DirectorySeparatorChar; + + Uri folderUri = new Uri(folder); + return Uri.UnescapeDataString(folderUri.MakeRelativeUri(pathUri).ToString().Replace('/', Path.DirectorySeparatorChar)); + } } } diff --git a/ICD.Common.Utils/IO/IcdStreamWriter.cs b/ICD.Common.Utils/IO/IcdStreamWriter.cs index 4d5604a..9e0da04 100644 --- a/ICD.Common.Utils/IO/IcdStreamWriter.cs +++ b/ICD.Common.Utils/IO/IcdStreamWriter.cs @@ -1,5 +1,4 @@ -using System; -#if SIMPLSHARP +#if SIMPLSHARP using Crestron.SimplSharp.CrestronIO; #elif STANDARD using System.IO;