diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-09-13 19:07:54 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-09-13 19:07:54 -0400 |
| commit | 8cf45a3e4a5345f704f8acef098b173ec1808251 (patch) | |
| tree | 06560c42256b91d02744369b8dc834ade8bc8ffb /MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs | |
| parent | 6cb184fcf8ea7803626e0f3e0a3c7f118e4328e9 (diff) | |
add more methods to IFileSystem
Diffstat (limited to 'MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs')
| -rw-r--r-- | MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs b/MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs index 6af59bb6b..276da58d4 100644 --- a/MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs +++ b/MediaBrowser.Common.Implementations/Configuration/ConfigurationHelper.cs @@ -19,7 +19,7 @@ namespace MediaBrowser.Common.Implementations.Configuration /// <param name="path">The path.</param> /// <param name="xmlSerializer">The XML serializer.</param> /// <returns>System.Object.</returns> - public static object GetXmlConfiguration(Type type, string path, IXmlSerializer xmlSerializer, IFileSystem fileSystem) + public static object GetXmlConfiguration(Type type, string path, IXmlSerializer xmlSerializer) { object configuration; @@ -28,7 +28,7 @@ namespace MediaBrowser.Common.Implementations.Configuration // Use try/catch to avoid the extra file system lookup using File.Exists try { - buffer = fileSystem.ReadAllBytes(path); + buffer = File.ReadAllBytes(path); configuration = xmlSerializer.DeserializeFromBytes(type, buffer); } @@ -47,10 +47,10 @@ namespace MediaBrowser.Common.Implementations.Configuration // If the file didn't exist before, or if something has changed, re-save if (buffer == null || !buffer.SequenceEqual(newBytes)) { - fileSystem.CreateDirectory(Path.GetDirectoryName(path)); + Directory.CreateDirectory(Path.GetDirectoryName(path)); // Save it after load in case we got new items - fileSystem.WriteAllBytes(path, newBytes); + File.WriteAllBytes(path, newBytes); } return configuration; |
