aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common/ApplicationPathHelper.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-05-24 15:12:55 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-05-24 15:12:55 -0400
commitf07af448fa11330db93dd7ddcabac37ef9e014c7 (patch)
tree1b52a4f73d674a48258c2f14c94117b96ca4a678 /MediaBrowser.Server.Startup.Common/ApplicationPathHelper.cs
parent27c3acb2bfde9025c33f584c759a4038020cb702 (diff)
update main projects
Diffstat (limited to 'MediaBrowser.Server.Startup.Common/ApplicationPathHelper.cs')
-rw-r--r--MediaBrowser.Server.Startup.Common/ApplicationPathHelper.cs51
1 files changed, 0 insertions, 51 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationPathHelper.cs b/MediaBrowser.Server.Startup.Common/ApplicationPathHelper.cs
deleted file mode 100644
index 254a782db..000000000
--- a/MediaBrowser.Server.Startup.Common/ApplicationPathHelper.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System;
-using System.Configuration;
-using System.IO;
-
-namespace MediaBrowser.Server.Startup.Common
-{
- 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"];
-
- programDataPath = programDataPath.Replace("%ApplicationData%", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
-
- 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;
- }
- }
-}