add more methods to IFileSystem

This commit is contained in:
Luke Pulverenti
2015-09-13 19:07:54 -04:00
parent 6cb184fcf8
commit 8cf45a3e4a
64 changed files with 296 additions and 149 deletions

View File

@@ -99,15 +99,15 @@ namespace MediaBrowser.Common.Implementations.Security
{
try
{
contents = _fileSystem.ReadAllLines(licenseFile);
contents = File.ReadAllLines(licenseFile);
}
catch (DirectoryNotFoundException)
{
(_fileSystem.CreateFile(licenseFile)).Close();
(File.Create(licenseFile)).Close();
}
catch (FileNotFoundException)
{
(_fileSystem.CreateFile(licenseFile)).Close();
(File.Create(licenseFile)).Close();
}
}
if (contents != null && contents.Length > 0)
@@ -150,8 +150,8 @@ namespace MediaBrowser.Common.Implementations.Security
}
var licenseFile = Filename;
_fileSystem.CreateDirectory(Path.GetDirectoryName(licenseFile));
lock (_fileLock) _fileSystem.WriteAllLines(licenseFile, lines);
Directory.CreateDirectory(Path.GetDirectoryName(licenseFile));
lock (_fileLock) File.WriteAllLines(licenseFile, lines);
}
}
}