From 6676ca4d1b6f8ba2c3582ab916ea9e2f88afae65 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Tue, 24 Nov 2020 05:06:36 +0000 Subject: Remove ResourceFileManager (#4567) --- Emby.Server.Implementations/ResourceFileManager.cs | 45 ---------------------- 1 file changed, 45 deletions(-) delete mode 100644 Emby.Server.Implementations/ResourceFileManager.cs (limited to 'Emby.Server.Implementations/ResourceFileManager.cs') 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 _logger; - - public ResourceFileManager(ILogger 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; - } - } -} -- cgit v1.2.3