aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/IO/IFileSystem.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-09-13 17:33:49 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-09-13 17:33:49 -0400
commit6cb184fcf8ea7803626e0f3e0a3c7f118e4328e9 (patch)
treead536b9317ce6bff56df0050c7299b754f4dc292 /MediaBrowser.Common/IO/IFileSystem.cs
parent21a2160fca35720e3d887b328a0b45a703baaad0 (diff)
parent14de062681026157c6917779a51af6fb7046cec2 (diff)
Merge branch 'dev' of https://github.com/MediaBrowser/MediaBrowser into dev
Diffstat (limited to 'MediaBrowser.Common/IO/IFileSystem.cs')
-rw-r--r--MediaBrowser.Common/IO/IFileSystem.cs57
1 files changed, 41 insertions, 16 deletions
diff --git a/MediaBrowser.Common/IO/IFileSystem.cs b/MediaBrowser.Common/IO/IFileSystem.cs
index 5ce84f436..60ba4c8ae 100644
--- a/MediaBrowser.Common/IO/IFileSystem.cs
+++ b/MediaBrowser.Common/IO/IFileSystem.cs
@@ -1,5 +1,7 @@
using System;
using System.IO;
+using System.Collections.Generic;
+using System.Text;
namespace MediaBrowser.Common.IO
{
@@ -73,7 +75,9 @@ namespace MediaBrowser.Common.IO
/// <param name="share">The share.</param>
/// <param name="isAsync">if set to <c>true</c> [is asynchronous].</param>
/// <returns>FileStream.</returns>
- FileStream GetFileStream(string path, FileMode mode, FileAccess access, FileShare share, bool isAsync = false);
+ Stream GetFileStream(string path, FileMode mode, FileAccess access, FileShare share, bool isAsync = false);
+
+ Stream OpenRead(String path);
/// <summary>
/// Swaps the files.
@@ -138,21 +142,6 @@ namespace MediaBrowser.Common.IO
/// Deletes the file.
/// </summary>
/// <param name="path">The path.</param>
- /// <param name="sendToRecycleBin">if set to <c>true</c> [send to recycle bin].</param>
- void DeleteFile(string path, bool sendToRecycleBin);
-
- /// <summary>
- /// Deletes the directory.
- /// </summary>
- /// <param name="path">The path.</param>
- /// <param name="recursive">if set to <c>true</c> [recursive].</param>
- /// <param name="sendToRecycleBin">if set to <c>true</c> [send to recycle bin].</param>
- void DeleteDirectory(string path, bool recursive, bool sendToRecycleBin);
-
- /// <summary>
- /// Deletes the file.
- /// </summary>
- /// <param name="path">The path.</param>
void DeleteFile(string path);
/// <summary>
@@ -161,5 +150,41 @@ namespace MediaBrowser.Common.IO
/// <param name="path">The path.</param>
/// <param name="recursive">if set to <c>true</c> [recursive].</param>
void DeleteDirectory(string path, bool recursive);
+
+ IEnumerable<DirectoryInfo> GetDirectories(string path, bool recursive = false);
+
+ IEnumerable<FileInfo> GetFiles(string path, bool recursive = false);
+
+ IEnumerable<FileSystemInfo> GetFileSystemEntries(string path, bool recursive = false);
+
+ void CreateDirectory(string path);
+
+ void CopyFile(string source, string target, bool overwrite);
+
+ void MoveFile(string source, string target);
+
+ void MoveDirectory(string source, string target);
+
+ bool DirectoryExists(string path);
+
+ bool FileExists(string path);
+
+ string ReadAllText(string path, Encoding encoding);
+
+ string ReadAllText(string path);
+
+ byte[] ReadAllBytes(string path);
+
+ void WriteAllBytes(string path, byte[] bytes);
+
+ void WriteAllText(string path, string text, Encoding encoding);
+
+ void WriteAllText(string path, string text);
+
+ void CreateFile(string path);
+
+ void WriteAllLines(string path, string[] lines);
+
+ string[] ReadAllLines(string path);
}
}