Files
BeWoPlaner/Service/ServiceUtils/Paths/ServerFilePaths.cs

64 lines
2.5 KiB
C#
Raw Normal View History

2022-08-30 09:12:20 +02:00
using System;
using System.Collections.Generic;
using System.Configuration;
2022-08-30 09:12:20 +02:00
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeWo.Service.ServiceUtils.Paths
{
public static class ServerFilePaths
{
// UpdateRootPath
// L specialTenant
// L tenant#1
// L exampleData#1
// L version
// L 1.0.0.0
// L _default
// L exampleData#2
// L tenant#1
// L exampleData#3
// L 1.0.0.1
// L _default
// L exampleData#4
// L tenant#1
// L exampleData#5
// L version.config
private static string _DownloadVersionFilePath;
private static string _DownloadFolderPath;
2022-12-14 12:08:20 +01:00
private static string _LogFolderPath;
2022-08-30 09:12:20 +02:00
2022-12-14 12:08:20 +01:00
public static string DownloadVersionFilePath => GetAppSettings(_DownloadVersionFilePath, "DownloadVersionFilePath");
public static string DownloadFolderPath => GetAppSettings(_DownloadFolderPath, "DownloadFolderPath");
2022-12-14 12:08:20 +01:00
public static string LogFolderPath => GetAppSettings(_LogFolderPath, "LogFolderPath");
static ServerFilePaths()
{
}
public static string GetOverrideTenantFolderPath() => Path.Combine(DownloadFolderPath, "overridetenant");
public static string GetOverrideTenantFolderPath(string tenant) => Path.Combine(GetOverrideTenantFolderPath(), tenant);
public static string GetVersionFolderPath() => Path.Combine(DownloadFolderPath, "version");
2022-08-30 09:12:20 +02:00
public static string GetVersionFolderPath(string version) => Path.Combine(GetVersionFolderPath(), version);
public static string GetVersionTenantFolderPath(string version, string tenant) => Path.Combine(GetVersionFolderPath(version), tenant);
public static string GetVersionDefaultFolderPath(string version) => GetVersionTenantFolderPath(version, "default");
public static string GetVersionConfigFilePath() => DownloadVersionFilePath;
2022-12-14 12:08:20 +01:00
public static string GetLogFolderPath(string tenant) => Path.Combine(LogFolderPath, tenant);
public static string GetAppSettings(string name, string setting)
{
if (name is null)
name = ConfigurationManager.AppSettings.Get(setting);
return name;
}
2022-08-30 09:12:20 +02:00
}
}