summaryrefslogtreecommitdiffstats
path: root/server/src/Data/Models/AppPath.cs
blob: e47e48c33df8939f751c341150aa63060ea096b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
namespace IOL.GreatOffice.Api.Data.Models;

public sealed record AppPath
{
	public string HostPath { get; init; }
	public string WebPath { get; init; }

	public string GetHostPathForFilename(string filename, string fallback = "") {
		if (filename.IsNullOrWhiteSpace()) {
			return fallback;
		}

		return Path.Combine(HostPath, filename);
	}

	public string GetWebPathForFilename(string filename, string fallback = "") {
		if (filename.IsNullOrWhiteSpace()) {
			return fallback;
		}

		return Path.Combine(WebPath, filename);
	}
}