Cloud drives

This commit is contained in:
2023-08-30 15:34:42 +02:00
parent 9b5a0f3123
commit c5712ae30c
18 changed files with 227 additions and 48 deletions

View File

@@ -1,3 +1,4 @@
using System.Collections;
using FileTime.Core.Models;
namespace FileTime.Core.Helper;
@@ -33,6 +34,7 @@ public static class PathHelper
return string.Join(Constants.SeparatorChar, commonPathParts);
}
public static string GetCommonPath(string? path1, string? path2)
{
var path1Parts = path1?.Split(Constants.SeparatorChar) ?? Array.Empty<string>();
@@ -51,4 +53,18 @@ public static class PathHelper
return string.Join(Constants.SeparatorChar, commonPathParts);
}
}
public static string ReplaceEnvironmentVariablePlaceHolders(string path)
{
foreach (DictionaryEntry environmentVariable in Environment.GetEnvironmentVariables())
{
var value = environmentVariable.Value?.ToString();
if (value is null) continue;
path = path.Replace($"%{environmentVariable.Key}%", value, StringComparison.OrdinalIgnoreCase);
}
return path;
}
}

View File

@@ -1,6 +0,0 @@
namespace FileTime.Core.Models;
public interface ISymlinkElement
{
IItem RealItem { get; }
}