Remove obsolete custom platform detection.

This commit is contained in:
Jojo-1000
2024-05-30 02:14:05 +02:00
parent 930f1c8bd3
commit 917e2cd0c4
35 changed files with 97 additions and 78 deletions
@@ -72,7 +72,7 @@ namespace Duplicati.Server.WebServer.RESTMethods
path = SpecialFolders.ExpandEnvironmentVariables(path);
if (Platform.IsClientPosix && !path.StartsWith("/", StringComparison.Ordinal))
if ((OperatingSystem.IsMacOS() || OperatingSystem.IsLinux()) && !path.StartsWith("/", StringComparison.Ordinal))
{
info.ReportClientError("The path parameter must start with a forward-slash", System.Net.HttpStatusCode.BadRequest);
return;
@@ -111,7 +111,7 @@ namespace Duplicati.Server.WebServer.RESTMethods
IEnumerable<Serializable.TreeNode> res;
if (!Platform.IsClientPosix && (path.Equals("/") || path.Equals("")))
if (!(OperatingSystem.IsMacOS() || OperatingSystem.IsLinux()) && (path.Equals("/") || path.Equals("")))
{
res = DriveInfo.GetDrives()
.Where(di =>
@@ -29,7 +29,7 @@ namespace Duplicati.Server.WebServer.RESTMethods
{
var exefolder = System.IO.Path.GetDirectoryName(Duplicati.Library.Utility.Utility.getEntryAssembly().Location);
var path = System.IO.Path.Combine(exefolder, "licenses");
if (Duplicati.Library.Common.Platform.IsClientOSX && !Directory.Exists(path))
if (OperatingSystem.IsMacOS() && !Directory.Exists(path))
{
// Go up one, as the licenses cannot be in the binary folder in MacOS Packages
exefolder = Path.GetDirectoryName(exefolder);
@@ -71,7 +71,7 @@ namespace Duplicati.Server.WebServer.RESTMethods
DefaultUpdateChannel = Duplicati.Library.AutoUpdater.AutoUpdateSettings.DefaultUpdateChannel,
DefaultUsageReportLevel = Duplicati.Library.UsageReporter.Reporter.DefaultReportLevel,
ServerTime = DateTime.Now,
OSType = Platform.IsClientPosix ? (Platform.IsClientOSX ? "OSX" : "Linux") : "Windows",
OSType = OperatingSystem.IsWindows() ? "Windows" : (OperatingSystem.IsMacOS() ? "OSX" : "Linux"),
DirectorySeparator = System.IO.Path.DirectorySeparatorChar,
PathSeparator = System.IO.Path.PathSeparator,
CaseSensitiveFilesystem = Duplicati.Library.Utility.Utility.IsFSCaseSensitive,