aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ResourceFileManager.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2020-12-04 13:50:44 +0100
committerGitHub <noreply@github.com>2020-12-04 13:50:44 +0100
commitdca3f62ff85ba62af95831848718e9764d163306 (patch)
tree5be2338b7ec18013fb18feb3325d3228b3e5da59 /Emby.Server.Implementations/ResourceFileManager.cs
parenteed1a40b1935e00e04f6b27c7d307bf110b83b31 (diff)
parent9afd19b06e025992ee5159a08d7af8bd736a828e (diff)
Merge branch 'master' into PlugsVersionNumberFix
Diffstat (limited to 'Emby.Server.Implementations/ResourceFileManager.cs')
-rw-r--r--Emby.Server.Implementations/ResourceFileManager.cs45
1 files changed, 0 insertions, 45 deletions
diff --git a/Emby.Server.Implementations/ResourceFileManager.cs b/Emby.Server.Implementations/ResourceFileManager.cs
deleted file mode 100644
index 22fc62293..000000000
--- a/Emby.Server.Implementations/ResourceFileManager.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using System.IO;
-using MediaBrowser.Controller;
-using MediaBrowser.Controller.Net;
-using MediaBrowser.Model.IO;
-using Microsoft.Extensions.Logging;
-
-namespace Emby.Server.Implementations
-{
- public class ResourceFileManager : IResourceFileManager
- {
- private readonly IFileSystem _fileSystem;
- private readonly ILogger<ResourceFileManager> _logger;
-
- public ResourceFileManager(ILogger<ResourceFileManager> logger, IFileSystem fileSystem)
- {
- _logger = logger;
- _fileSystem = fileSystem;
- }
-
- public string GetResourcePath(string basePath, string virtualPath)
- {
- var fullPath = Path.Combine(basePath, virtualPath.Replace('/', Path.DirectorySeparatorChar));
-
- try
- {
- fullPath = Path.GetFullPath(fullPath);
- }
- catch (Exception ex)
- {
- _logger.LogError(ex, "Error retrieving full path");
- }
-
- // Don't allow file system access outside of the source folder
- if (!_fileSystem.ContainsSubPath(basePath, fullPath))
- {
- throw new SecurityException("Access denied");
- }
-
- return fullPath;
- }
- }
-}