aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-10-26 18:50:19 -0400
committerLuke <luke.pulverenti@gmail.com>2015-10-26 18:50:19 -0400
commit35778ebc02e5931142a1fe31a256b7488a07c5c2 (patch)
treeced0290be8820f5e507b51ca4c5165212b1879d1 /MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs
parentc0dc8d055bfd4d2f58591083beb9e9128357aad6 (diff)
parent8d77308593c3b16b733b0109323770d9dfe7e166 (diff)
Merge pull request #1222 from MediaBrowser/dev
3.0.5768.7
Diffstat (limited to 'MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs15
1 files changed, 11 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs
index bf199503b..a7d3854e7 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 CommonIO;
namespace MediaBrowser.Server.Implementations.Configuration
{
@@ -23,14 +24,16 @@ namespace MediaBrowser.Server.Implementations.Configuration
/// </summary>
public class ServerConfigurationManager : BaseConfigurationManager, IServerConfigurationManager
{
+
/// <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)
- : base(applicationPaths, logManager, xmlSerializer)
+ /// <param name="fileSystem">The file system.</param>
+ public ServerConfigurationManager(IApplicationPaths applicationPaths, ILogManager logManager, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
+ : base(applicationPaths, logManager, xmlSerializer, fileSystem)
{
UpdateItemsByNamePath();
UpdateMetadataPath();
@@ -198,10 +201,12 @@ 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));
}
+
+ EnsureWriteAccess(newPath);
}
}
@@ -218,10 +223,12 @@ 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));
}
+
+ EnsureWriteAccess(newPath);
}
}