Hermod
A cross-platform, modular and fully GDPR-compliant email archival solution!
Loading...
Searching...
No Matches
AppInfo.cs
Go to the documentation of this file.
1using System;
2
3namespace Hermod.Core {
4
5 using System.IO;
6
10 public static partial class AppInfo {
11
15 public static string HermodAppDirName => ".hermod";
16
20 public static string HermodAppCfgDirName => "cfg";
21
25 public static string HermodAppPluginDirName => "plugins";
26
31 public static string HermodLogDirName => "log";
32
37 public static DirectoryInfo GetBaseHermodDirectory() {
38 string? basePath = null;
39 switch (Environment.OSVersion.Platform) {
40 case PlatformID.Win32NT:
41 basePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
42 break;
43 default:
44 basePath = "/etc";
45 break;
46 // leave room to diversify later
47 }
48
49 return new DirectoryInfo(Path.Combine(basePath, HermodAppDirName));
50 }
51
59 public static DirectoryInfo GetLocalHermodDirectory() {
60 string? basePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
61
62 return new DirectoryInfo(Path.Combine(basePath, HermodAppDirName));
63 }
64
65 }
66}
67
Static class containing basic information for and about the application.
Definition: AppInfo.cs:10
static string HermodAppCfgDirName
Gets the name of the application's config directory.
Definition: AppInfo.cs:20
static string HermodAppDirName
Gets the name of this application's main data directory.
Definition: AppInfo.cs:15
static string HermodAppPluginDirName
Gets the name of the application's plugins directory.
Definition: AppInfo.cs:25
static DirectoryInfo GetLocalHermodDirectory()
Gets the application's local data directory.
Definition: AppInfo.cs:59
static DirectoryInfo GetBaseHermodDirectory()
Gets the application's base data directory.
Definition: AppInfo.cs:37
static string HermodLogDirName
Gets the name of the application's log directory. Typically this is stored.
Definition: AppInfo.cs:31