mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-01 06:16:30 +01:00
update file system methods
This commit is contained in:
@@ -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.
|
||||
@@ -134,21 +138,6 @@ namespace MediaBrowser.Common.IO
|
||||
/// <returns><c>true</c> if [is path file] [the specified path]; otherwise, <c>false</c>.</returns>
|
||||
bool IsPathFile(string path);
|
||||
|
||||
/// <summary>
|
||||
/// 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>
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user