diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Configuration')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs index bf199503b..050b79db7 100644 --- a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -15,6 +15,7 @@ using MediaBrowser.Model.Serialization; using System; using System.IO; using System.Linq; +using MediaBrowser.Common.IO; namespace MediaBrowser.Server.Implementations.Configuration { @@ -23,15 +24,18 @@ namespace MediaBrowser.Server.Implementations.Configuration /// </summary> public class ServerConfigurationManager : BaseConfigurationManager, IServerConfigurationManager { + private readonly IFileSystem _fileSystem; + /// <summary> /// Initializes a new instance of the <see cref="ServerConfigurationManager" /> class. /// </summary> /// <param name="applicationPaths">The application paths.</param> /// <param name="logManager">The log manager.</param> /// <param name="xmlSerializer">The XML serializer.</param> - public ServerConfigurationManager(IApplicationPaths applicationPaths, ILogManager logManager, IXmlSerializer xmlSerializer) + public ServerConfigurationManager(IApplicationPaths applicationPaths, ILogManager logManager, IXmlSerializer xmlSerializer, IFileSystem fileSystem) : base(applicationPaths, logManager, xmlSerializer) { + _fileSystem = fileSystem; UpdateItemsByNamePath(); UpdateMetadataPath(); } @@ -198,7 +202,7 @@ namespace MediaBrowser.Server.Implementations.Configuration && !string.Equals(Configuration.ItemsByNamePath ?? string.Empty, newPath)) { // Validate - if (!Directory.Exists(newPath)) + if (!_fileSystem.DirectoryExists(newPath)) { throw new DirectoryNotFoundException(string.Format("{0} does not exist.", newPath)); } @@ -218,7 +222,7 @@ namespace MediaBrowser.Server.Implementations.Configuration && !string.Equals(Configuration.MetadataPath ?? string.Empty, newPath)) { // Validate - if (!Directory.Exists(newPath)) + if (!_fileSystem.DirectoryExists(newPath)) { throw new DirectoryNotFoundException(string.Format("{0} does not exist.", newPath)); } |
