aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ResourceFileManager.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2020-11-27 09:46:18 -0500
committerGitHub <noreply@github.com>2020-11-27 09:46:18 -0500
commitc98c2ab955230358d00fbc64ebeddeec300e88d0 (patch)
tree9e3084b4b8eed37a5b82c6d97c729ea6f53ae40b /Emby.Server.Implementations/ResourceFileManager.cs
parent9c20701cf62a7a39235b0b4d4471297770432670 (diff)
parent9169a28df195b999c3813f842780dd7763bbcc9f (diff)
Merge branch 'master' into syncplay-enhanced
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;
- }
- }
-}