mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
Use DI for IFileSystem
This commit is contained in:
@@ -15,10 +15,6 @@ namespace Emby.Server.Implementations.IO
|
||||
/// </summary>
|
||||
public class ManagedFileSystem : IFileSystem
|
||||
{
|
||||
private readonly ILogger<ManagedFileSystem> _logger;
|
||||
|
||||
private readonly List<IShortcutHandler> _shortcutHandlers = new List<IShortcutHandler>();
|
||||
private readonly string _tempPath;
|
||||
private static readonly bool _isEnvironmentCaseInsensitive = OperatingSystem.IsWindows();
|
||||
private static readonly char[] _invalidPathCharacters =
|
||||
{
|
||||
@@ -29,23 +25,24 @@ namespace Emby.Server.Implementations.IO
|
||||
(char)31, ':', '*', '?', '\\', '/'
|
||||
};
|
||||
|
||||
private readonly ILogger<ManagedFileSystem> _logger;
|
||||
private readonly List<IShortcutHandler> _shortcutHandlers;
|
||||
private readonly string _tempPath;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ManagedFileSystem"/> class.
|
||||
/// </summary>
|
||||
/// <param name="logger">The <see cref="ILogger"/> instance to use.</param>
|
||||
/// <param name="applicationPaths">The <see cref="IApplicationPaths"/> instance to use.</param>
|
||||
/// <param name="shortcutHandlers">the <see cref="IShortcutHandler"/>'s to use.</param>
|
||||
public ManagedFileSystem(
|
||||
ILogger<ManagedFileSystem> logger,
|
||||
IApplicationPaths applicationPaths)
|
||||
IApplicationPaths applicationPaths,
|
||||
IEnumerable<IShortcutHandler> shortcutHandlers)
|
||||
{
|
||||
_logger = logger;
|
||||
_tempPath = applicationPaths.TempDirectory;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void AddShortcutHandler(IShortcutHandler handler)
|
||||
{
|
||||
_shortcutHandlers.Add(handler);
|
||||
_shortcutHandlers = shortcutHandlers.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user