From 8cf45a3e4a5345f704f8acef098b173ec1808251 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 13 Sep 2015 19:07:54 -0400 Subject: add more methods to IFileSystem --- .../IO/CommonFileSystem.cs | 52 +++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs') diff --git a/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs b/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs index 5951dbb31..2dd2575ad 100644 --- a/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs +++ b/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs @@ -107,7 +107,7 @@ namespace MediaBrowser.Common.Implementations.IO throw new ArgumentNullException("target"); } - _fileSystem.WriteAllText(shortcutPath, target); + File.WriteAllText(shortcutPath, target); } /// @@ -449,5 +449,55 @@ namespace MediaBrowser.Common.Implementations.IO return directoryInfo.EnumerateDirectories("*", searchOption) .Concat(directoryInfo.EnumerateFiles("*", searchOption)); } + + public Stream OpenRead(string path) + { + return File.OpenRead(path); + } + + public void CopyFile(string source, string target, bool overwrite) + { + File.Copy(source, target, overwrite); + } + + public void MoveFile(string source, string target) + { + File.Move(source, target); + } + + public void MoveDirectory(string source, string target) + { + Directory.Move(source, target); + } + + public bool DirectoryExists(string path) + { + return Directory.Exists(path); + } + + public bool FileExists(string path) + { + return File.Exists(path); + } + + public string ReadAllText(string path) + { + return File.ReadAllText(path); + } + + public void WriteAllText(string path, string text, Encoding encoding) + { + File.WriteAllText(path, text, encoding); + } + + public void WriteAllText(string path, string text) + { + File.WriteAllText(path, text); + } + + public string ReadAllText(string path, Encoding encoding) + { + return File.ReadAllText(path, encoding); + } } } -- cgit v1.2.3