update file system methods

This commit is contained in:
Luke
2015-09-13 17:32:02 -04:00
parent 0f743205c4
commit 14de062681
129 changed files with 482 additions and 872 deletions

View File

@@ -90,8 +90,8 @@ namespace MediaBrowser.Server.Implementations.Connect
try
{
Directory.CreateDirectory(Path.GetDirectoryName(path));
File.WriteAllText(path, address, Encoding.UTF8);
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
_fileSystem.WriteAllText(path, address, Encoding.UTF8);
}
catch (Exception ex)
{
@@ -105,7 +105,7 @@ namespace MediaBrowser.Server.Implementations.Connect
try
{
var endpoint = File.ReadAllText(path, Encoding.UTF8);
var endpoint = _fileSystem.ReadAllText(path, Encoding.UTF8);
if (IsValid(endpoint))
{

View File

@@ -315,7 +315,7 @@ namespace MediaBrowser.Server.Implementations.Connect
try
{
Directory.CreateDirectory(Path.GetDirectoryName(path));
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
var json = _json.SerializeToString(_data);
@@ -323,7 +323,7 @@ namespace MediaBrowser.Server.Implementations.Connect
lock (_dataFileLock)
{
File.WriteAllText(path, encrypted, Encoding.UTF8);
_fileSystem.WriteAllText(path, encrypted, Encoding.UTF8);
}
}
catch (Exception ex)
@@ -340,7 +340,7 @@ namespace MediaBrowser.Server.Implementations.Connect
{
lock (_dataFileLock)
{
var encrypted = File.ReadAllText(path, Encoding.UTF8);
var encrypted = _fileSystem.ReadAllText(path, Encoding.UTF8);
var json = _encryption.DecryptString(encrypted);