aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Mono/ApplicationPathHelper.cs
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2018-12-14 21:28:12 -0500
committerGitHub <noreply@github.com>2018-12-14 21:28:12 -0500
commit46c75d75bd8702da4d3728c11f28756a9c9abb72 (patch)
treedd6a198e3c104ebc732a615153c4bb5514e25660 /MediaBrowser.Server.Mono/ApplicationPathHelper.cs
parentb36b526f27ebd9ac716d743eea26e65407ceeea4 (diff)
parenta73d255f51f135adbc2c352fef79f776ce9fcb02 (diff)
Merge pull request #166 from jellyfin/develop
Develop
Diffstat (limited to 'MediaBrowser.Server.Mono/ApplicationPathHelper.cs')
-rw-r--r--MediaBrowser.Server.Mono/ApplicationPathHelper.cs60
1 files changed, 0 insertions, 60 deletions
diff --git a/MediaBrowser.Server.Mono/ApplicationPathHelper.cs b/MediaBrowser.Server.Mono/ApplicationPathHelper.cs
deleted file mode 100644
index ac55693fa..000000000
--- a/MediaBrowser.Server.Mono/ApplicationPathHelper.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using System;
-using System.Configuration;
-using System.IO;
-using System.Runtime.InteropServices;
-
-namespace MediaBrowser.Server.Mono
-{
- public static class ApplicationPathHelper
- {
- /// <summary>
- /// Gets the path to the application's ProgramDataFolder
- /// </summary>
- /// <returns>System.String.</returns>
- public static string GetProgramDataPath(string applicationPath)
- {
- var useDebugPath = false;
-
-#if DEBUG
- useDebugPath = true;
-#endif
-
- var programDataPath = useDebugPath ?
- ConfigurationManager.AppSettings["DebugProgramDataPath"] :
- ConfigurationManager.AppSettings["ReleaseProgramDataPath"];
-
- if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- programDataPath = programDataPath.Replace("%ApplicationData%", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
- }
- else
- {
- programDataPath = programDataPath.Replace("%ApplicationData%", "/var/lib");
- }
-
-
- programDataPath = programDataPath
- .Replace('/', Path.DirectorySeparatorChar)
- .Replace('\\', Path.DirectorySeparatorChar);
-
- // If it's a relative path, e.g. "..\"
- if (!Path.IsPathRooted(programDataPath))
- {
- var path = Path.GetDirectoryName(applicationPath);
-
- if (string.IsNullOrEmpty(path))
- {
- throw new ApplicationException("Unable to determine running assembly location");
- }
-
- programDataPath = Path.Combine(path, programDataPath);
-
- programDataPath = Path.GetFullPath(programDataPath);
- }
-
- Directory.CreateDirectory(programDataPath);
-
- return programDataPath;
- }
- }
-}