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/IO/CommonFileSystem.cs | |
| parent | 6cb184fcf8ea7803626e0f3e0a3c7f118e4328e9 (diff) | |
add more methods to IFileSystem
Diffstat (limited to 'MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs')
| -rw-r--r-- | MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs | 52 |
1 files changed, 51 insertions, 1 deletions
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); } /// <summary> @@ -449,5 +449,55 @@ namespace MediaBrowser.Common.Implementations.IO return directoryInfo.EnumerateDirectories("*", searchOption) .Concat<FileSystemInfo>(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); + } } } |
