From 48facb797ed912e4ea6b04b17d1ff190ac2daac4 Mon Sep 17 00:00:00 2001 From: stefan Date: Wed, 12 Sep 2018 19:26:21 +0200 Subject: Update to 3.5.2 and .net core 2.1 --- MediaBrowser.Model/IO/FileSystemEntryInfo.cs | 27 -- MediaBrowser.Model/IO/FileSystemEntryType.cs | 25 -- MediaBrowser.Model/IO/FileSystemMetadata.cs | 56 ---- MediaBrowser.Model/IO/IFileSystem.cs | 450 -------------------------- MediaBrowser.Model/IO/IIsoManager.cs | 34 -- MediaBrowser.Model/IO/IIsoMount.cs | 22 -- MediaBrowser.Model/IO/IIsoMounter.cs | 51 --- MediaBrowser.Model/IO/IMemoryStreamFactory.cs | 12 - MediaBrowser.Model/IO/IShortcutHandler.cs | 25 -- MediaBrowser.Model/IO/IZipClient.cs | 85 ----- MediaBrowser.Model/IO/StreamDefaults.cs | 19 -- 11 files changed, 806 deletions(-) delete mode 100644 MediaBrowser.Model/IO/FileSystemEntryInfo.cs delete mode 100644 MediaBrowser.Model/IO/FileSystemEntryType.cs delete mode 100644 MediaBrowser.Model/IO/FileSystemMetadata.cs delete mode 100644 MediaBrowser.Model/IO/IFileSystem.cs delete mode 100644 MediaBrowser.Model/IO/IIsoManager.cs delete mode 100644 MediaBrowser.Model/IO/IIsoMount.cs delete mode 100644 MediaBrowser.Model/IO/IIsoMounter.cs delete mode 100644 MediaBrowser.Model/IO/IMemoryStreamFactory.cs delete mode 100644 MediaBrowser.Model/IO/IShortcutHandler.cs delete mode 100644 MediaBrowser.Model/IO/IZipClient.cs delete mode 100644 MediaBrowser.Model/IO/StreamDefaults.cs (limited to 'MediaBrowser.Model/IO') diff --git a/MediaBrowser.Model/IO/FileSystemEntryInfo.cs b/MediaBrowser.Model/IO/FileSystemEntryInfo.cs deleted file mode 100644 index f17e2e5c34..0000000000 --- a/MediaBrowser.Model/IO/FileSystemEntryInfo.cs +++ /dev/null @@ -1,27 +0,0 @@ - -namespace MediaBrowser.Model.IO -{ - /// - /// Class FileSystemEntryInfo - /// - public class FileSystemEntryInfo - { - /// - /// Gets or sets the name. - /// - /// The name. - public string Name { get; set; } - - /// - /// Gets or sets the path. - /// - /// The path. - public string Path { get; set; } - - /// - /// Gets or sets the type. - /// - /// The type. - public FileSystemEntryType Type { get; set; } - } -} diff --git a/MediaBrowser.Model/IO/FileSystemEntryType.cs b/MediaBrowser.Model/IO/FileSystemEntryType.cs deleted file mode 100644 index e7c67c6061..0000000000 --- a/MediaBrowser.Model/IO/FileSystemEntryType.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace MediaBrowser.Model.IO -{ - /// - /// Enum FileSystemEntryType - /// - public enum FileSystemEntryType - { - /// - /// The file - /// - File, - /// - /// The directory - /// - Directory, - /// - /// The network computer - /// - NetworkComputer, - /// - /// The network share - /// - NetworkShare - } -} \ No newline at end of file diff --git a/MediaBrowser.Model/IO/FileSystemMetadata.cs b/MediaBrowser.Model/IO/FileSystemMetadata.cs deleted file mode 100644 index 2aae4bb54d..0000000000 --- a/MediaBrowser.Model/IO/FileSystemMetadata.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; - -namespace MediaBrowser.Model.IO -{ - public class FileSystemMetadata - { - /// - /// Gets or sets a value indicating whether this is exists. - /// - /// true if exists; otherwise, false. - public bool Exists { get; set; } - /// - /// Gets or sets the full name. - /// - /// The full name. - public string FullName { get; set; } - /// - /// Gets or sets the name. - /// - /// The name. - public string Name { get; set; } - /// - /// Gets or sets the extension. - /// - /// The extension. - public string Extension { get; set; } - /// - /// Gets or sets the length. - /// - /// The length. - public long Length { get; set; } - /// - /// Gets or sets the name of the directory. - /// - /// The name of the directory. - public string DirectoryName { get; set; } - - /// - /// Gets or sets the last write time UTC. - /// - /// The last write time UTC. - public DateTime LastWriteTimeUtc { get; set; } - /// - /// Gets or sets the creation time UTC. - /// - /// The creation time UTC. - public DateTime CreationTimeUtc { get; set; } - /// - /// Gets a value indicating whether this instance is directory. - /// - /// true if this instance is directory; otherwise, false. - public bool IsDirectory { get; set; } - public bool IsHidden { get; set; } - public bool IsReadOnly { get; set; } - } -} diff --git a/MediaBrowser.Model/IO/IFileSystem.cs b/MediaBrowser.Model/IO/IFileSystem.cs deleted file mode 100644 index ea6b048248..0000000000 --- a/MediaBrowser.Model/IO/IFileSystem.cs +++ /dev/null @@ -1,450 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; - -namespace MediaBrowser.Model.IO -{ - /// - /// Interface IFileSystem - /// - public interface IFileSystem - { - void AddShortcutHandler(IShortcutHandler handler); - - /// - /// Determines whether the specified filename is shortcut. - /// - /// The filename. - /// true if the specified filename is shortcut; otherwise, false. - bool IsShortcut(string filename); - - /// - /// Resolves the shortcut. - /// - /// The filename. - /// System.String. - string ResolveShortcut(string filename); - - /// - /// Creates the shortcut. - /// - /// The shortcut path. - /// The target. - void CreateShortcut(string shortcutPath, string target); - - /// - /// Returns a object for the specified file or directory path. - /// - /// A path to a file or directory. - /// A object. - /// If the specified path points to a directory, the returned object's - /// property will be set to true and all other properties will reflect the properties of the directory. - FileSystemMetadata GetFileSystemInfo(string path); - - /// - /// Returns a object for the specified file path. - /// - /// A path to a file. - /// A object. - /// If the specified path points to a directory, the returned object's - /// property and the property will both be set to false. - /// For automatic handling of files and directories, use . - FileSystemMetadata GetFileInfo(string path); - - /// - /// Returns a object for the specified directory path. - /// - /// A path to a directory. - /// A object. - /// If the specified path points to a file, the returned object's - /// property will be set to true and the property will be set to false. - /// For automatic handling of files and directories, use . - FileSystemMetadata GetDirectoryInfo(string path); - - /// - /// Gets the valid filename. - /// - /// The filename. - /// System.String. - string GetValidFilename(string filename); - - /// - /// Gets the creation time UTC. - /// - /// The information. - /// DateTime. - DateTime GetCreationTimeUtc(FileSystemMetadata info); - - /// - /// Gets the creation time UTC. - /// - /// The path. - /// DateTime. - DateTime GetCreationTimeUtc(string path); - - /// - /// Gets the last write time UTC. - /// - /// The information. - /// DateTime. - DateTime GetLastWriteTimeUtc(FileSystemMetadata info); - - /// - /// Gets the last write time UTC. - /// - /// The path. - /// DateTime. - DateTime GetLastWriteTimeUtc(string path); - - /// - /// Gets the file stream. - /// - /// The path. - /// The mode. - /// The access. - /// The share. - /// if set to true [is asynchronous]. - /// FileStream. - Stream GetFileStream(string path, FileOpenMode mode, FileAccessMode access, FileShareMode share, bool isAsync = false); - - Stream GetFileStream(string path, FileOpenMode mode, FileAccessMode access, FileShareMode share, FileOpenOptions fileOpenOptions); - - /// - /// Opens the read. - /// - /// The path. - /// Stream. - Stream OpenRead(String path); - - /// - /// Swaps the files. - /// - /// The file1. - /// The file2. - void SwapFiles(string file1, string file2); - - bool AreEqual(string path1, string path2); - - /// - /// Determines whether [contains sub path] [the specified parent path]. - /// - /// The parent path. - /// The path. - /// true if [contains sub path] [the specified parent path]; otherwise, false. - bool ContainsSubPath(string parentPath, string path); - - /// - /// Determines whether [is root path] [the specified path]. - /// - /// The path. - /// true if [is root path] [the specified path]; otherwise, false. - bool IsRootPath(string path); - - /// - /// Normalizes the path. - /// - /// The path. - /// System.String. - string NormalizePath(string path); - - string GetDirectoryName(string path); - - /// - /// Gets the file name without extension. - /// - /// The information. - /// System.String. - string GetFileNameWithoutExtension(FileSystemMetadata info); - - /// - /// Gets the file name without extension. - /// - /// The path. - /// System.String. - string GetFileNameWithoutExtension(string path); - - /// - /// Determines whether [is path file] [the specified path]. - /// - /// The path. - /// true if [is path file] [the specified path]; otherwise, false. - bool IsPathFile(string path); - - /// - /// Deletes the file. - /// - /// The path. - void DeleteFile(string path); - - /// - /// Deletes the directory. - /// - /// The path. - /// if set to true [recursive]. - void DeleteDirectory(string path, bool recursive); - - /// - /// Gets the directories. - /// - /// The path. - /// if set to true [recursive]. - /// IEnumerable<DirectoryInfo>. - IEnumerable GetDirectories(string path, bool recursive = false); - - /// - /// Gets the files. - /// - IEnumerable GetFiles(string path, bool recursive = false); - - IEnumerable GetFiles(string path, string [] extensions, bool enableCaseSensitiveExtensions, bool recursive); - - /// - /// Gets the file system entries. - /// - /// The path. - /// if set to true [recursive]. - /// IEnumerable<FileSystemMetadata>. - IEnumerable GetFileSystemEntries(string path, bool recursive = false); - - /// - /// Creates the directory. - /// - /// The path. - void CreateDirectory(string path); - - /// - /// Copies the file. - /// - /// The source. - /// The target. - /// if set to true [overwrite]. - void CopyFile(string source, string target, bool overwrite); - - /// - /// Moves the file. - /// - /// The source. - /// The target. - void MoveFile(string source, string target); - - /// - /// Moves the directory. - /// - /// The source. - /// The target. - void MoveDirectory(string source, string target); - - /// - /// Directories the exists. - /// - /// The path. - /// true if XXXX, false otherwise. - bool DirectoryExists(string path); - - /// - /// Files the exists. - /// - /// The path. - /// true if XXXX, false otherwise. - bool FileExists(string path); - - /// - /// Reads all text. - /// - /// The path. - /// System.String. - string ReadAllText(string path); - - byte[] ReadAllBytes(string path); - - void WriteAllBytes(string path, byte[] bytes); - - /// - /// Writes all text. - /// - /// The path. - /// The text. - void WriteAllText(string path, string text); - - /// - /// Writes all text. - /// - /// The path. - /// The text. - /// The encoding. - void WriteAllText(string path, string text, Encoding encoding); - - /// - /// Reads all text. - /// - /// The path. - /// The encoding. - /// System.String. - string ReadAllText(string path, Encoding encoding); - - string[] ReadAllLines(string path); - - void WriteAllLines(string path, IEnumerable lines); - - /// - /// Gets the directory paths. - /// - /// The path. - /// if set to true [recursive]. - /// IEnumerable<System.String>. - IEnumerable GetDirectoryPaths(string path, bool recursive = false); - - /// - /// Gets the file paths. - /// - /// The path. - /// if set to true [recursive]. - /// IEnumerable<System.String>. - IEnumerable GetFilePaths(string path, bool recursive = false); - IEnumerable GetFilePaths(string path, string[] extensions, bool enableCaseSensitiveExtensions, bool recursive); - - /// - /// Gets the file system entry paths. - /// - /// The path. - /// if set to true [recursive]. - /// IEnumerable<System.String>. - IEnumerable GetFileSystemEntryPaths(string path, bool recursive = false); - - void SetHidden(string path, bool isHidden); - void SetReadOnly(string path, bool readOnly); - void SetAttributes(string path, bool isHidden, bool readOnly); - - char DirectorySeparatorChar { get; } - - string GetFullPath(string path); - - List GetDrives(); - - void SetExecutable(string path); - } - - public enum FileOpenMode - { - // - // Summary: - // Specifies that the operating system should create a new file. This requires System.Security.Permissions.FileIOPermissionAccess.Write - // permission. If the file already exists, an System.IO.IOException exception is - // thrown. - CreateNew = 1, - // - // Summary: - // Specifies that the operating system should create a new file. If the file already - // exists, it will be overwritten. This requires System.Security.Permissions.FileIOPermissionAccess.Write - // permission. FileMode.Create is equivalent to requesting that if the file does - // not exist, use System.IO.FileMode.CreateNew; otherwise, use System.IO.FileMode.Truncate. - // If the file already exists but is a hidden file, an System.UnauthorizedAccessException - // exception is thrown. - Create = 2, - // - // Summary: - // Specifies that the operating system should open an existing file. The ability - // to open the file is dependent on the value specified by the System.IO.FileAccess - // enumeration. A System.IO.FileNotFoundException exception is thrown if the file - // does not exist. - Open = 3, - // - // Summary: - // Specifies that the operating system should open a file if it exists; otherwise, - // a new file should be created. If the file is opened with FileAccess.Read, System.Security.Permissions.FileIOPermissionAccess.Read - // permission is required. If the file access is FileAccess.Write, System.Security.Permissions.FileIOPermissionAccess.Write - // permission is required. If the file is opened with FileAccess.ReadWrite, both - // System.Security.Permissions.FileIOPermissionAccess.Read and System.Security.Permissions.FileIOPermissionAccess.Write - // permissions are required. - OpenOrCreate = 4 - } - - public enum FileAccessMode - { - // - // Summary: - // Read access to the file. Data can be read from the file. Combine with Write for - // read/write access. - Read = 1, - // - // Summary: - // Write access to the file. Data can be written to the file. Combine with Read - // for read/write access. - Write = 2 - } - - public enum FileShareMode - { - // - // Summary: - // Declines sharing of the current file. Any request to open the file (by this process - // or another process) will fail until the file is closed. - None = 0, - // - // Summary: - // Allows subsequent opening of the file for reading. If this flag is not specified, - // any request to open the file for reading (by this process or another process) - // will fail until the file is closed. However, even if this flag is specified, - // additional permissions might still be needed to access the file. - Read = 1, - // - // Summary: - // Allows subsequent opening of the file for writing. If this flag is not specified, - // any request to open the file for writing (by this process or another process) - // will fail until the file is closed. However, even if this flag is specified, - // additional permissions might still be needed to access the file. - Write = 2, - // - // Summary: - // Allows subsequent opening of the file for reading or writing. If this flag is - // not specified, any request to open the file for reading or writing (by this process - // or another process) will fail until the file is closed. However, even if this - // flag is specified, additional permissions might still be needed to access the - // file. - ReadWrite = 3 - } - - // - // Summary: - // Represents advanced options for creating a System.IO.FileStream object. - [Flags] - public enum FileOpenOptions - { - // - // Summary: - // Indicates that the system should write through any intermediate cache and go - // directly to disk. - WriteThrough = int.MinValue, - // - // Summary: - // Indicates that no additional options should be used when creating a System.IO.FileStream - // object. - None = 0, - // - // Summary: - // Indicates that a file is encrypted and can be decrypted only by using the same - // user account used for encryption. - Encrypted = 16384, - // - // Summary: - // Indicates that a file is automatically deleted when it is no longer in use. - DeleteOnClose = 67108864, - // - // Summary: - // Indicates that the file is to be accessed sequentially from beginning to end. - // The system can use this as a hint to optimize file caching. If an application - // moves the file pointer for random access, optimum caching may not occur; however, - // correct operation is still guaranteed. - SequentialScan = 134217728, - // - // Summary: - // Indicates that the file is accessed randomly. The system can use this as a hint - // to optimize file caching. - RandomAccess = 268435456, - // - // Summary: - // Indicates that a file can be used for asynchronous reading and writing. - Asynchronous = 1073741824 - } -} diff --git a/MediaBrowser.Model/IO/IIsoManager.cs b/MediaBrowser.Model/IO/IIsoManager.cs deleted file mode 100644 index 92c4d5aee8..0000000000 --- a/MediaBrowser.Model/IO/IIsoManager.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace MediaBrowser.Model.IO -{ - public interface IIsoManager : IDisposable - { - /// - /// Mounts the specified iso path. - /// - /// The iso path. - /// The cancellation token. - /// IsoMount. - /// isoPath - /// Unable to create mount. - Task Mount(string isoPath, CancellationToken cancellationToken); - - /// - /// Determines whether this instance can mount the specified path. - /// - /// The path. - /// true if this instance can mount the specified path; otherwise, false. - bool CanMount(string path); - - /// - /// Adds the parts. - /// - /// The mounters. - void AddParts(IEnumerable mounters); - } -} \ No newline at end of file diff --git a/MediaBrowser.Model/IO/IIsoMount.cs b/MediaBrowser.Model/IO/IIsoMount.cs deleted file mode 100644 index 4f8f8b5d25..0000000000 --- a/MediaBrowser.Model/IO/IIsoMount.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace MediaBrowser.Model.IO -{ - /// - /// Interface IIsoMount - /// - public interface IIsoMount : IDisposable - { - /// - /// Gets or sets the iso path. - /// - /// The iso path. - string IsoPath { get; } - - /// - /// Gets the mounted path. - /// - /// The mounted path. - string MountedPath { get; } - } -} \ No newline at end of file diff --git a/MediaBrowser.Model/IO/IIsoMounter.cs b/MediaBrowser.Model/IO/IIsoMounter.cs deleted file mode 100644 index 6684e7eff6..0000000000 --- a/MediaBrowser.Model/IO/IIsoMounter.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace MediaBrowser.Model.IO -{ - public interface IIsoMounter : IDisposable - { - /// - /// Mounts the specified iso path. - /// - /// The iso path. - /// The cancellation token. - /// IsoMount. - /// isoPath - /// Unable to create mount. - Task Mount(string isoPath, CancellationToken cancellationToken); - - /// - /// Determines whether this instance can mount the specified path. - /// - /// The path. - /// true if this instance can mount the specified path; otherwise, false. - bool CanMount(string path); - - /// - /// Gets a value indicating whether [requires installation]. - /// - /// true if [requires installation]; otherwise, false. - bool RequiresInstallation { get; } - - /// - /// Gets a value indicating whether this instance is installed. - /// - /// true if this instance is installed; otherwise, false. - bool IsInstalled { get; } - - /// - /// Installs this instance. - /// - /// Task. - Task Install(CancellationToken cancellationToken); - - /// - /// Gets the name. - /// - /// The name. - string Name { get; } - } -} diff --git a/MediaBrowser.Model/IO/IMemoryStreamFactory.cs b/MediaBrowser.Model/IO/IMemoryStreamFactory.cs deleted file mode 100644 index f4f1746430..0000000000 --- a/MediaBrowser.Model/IO/IMemoryStreamFactory.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.IO; - -namespace MediaBrowser.Model.IO -{ - public interface IMemoryStreamFactory - { - MemoryStream CreateNew(); - MemoryStream CreateNew(int capacity); - MemoryStream CreateNew(byte[] buffer); - bool TryGetBuffer(MemoryStream stream, out byte[] buffer); - } -} diff --git a/MediaBrowser.Model/IO/IShortcutHandler.cs b/MediaBrowser.Model/IO/IShortcutHandler.cs deleted file mode 100644 index 16255e51f0..0000000000 --- a/MediaBrowser.Model/IO/IShortcutHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ - -namespace MediaBrowser.Model.IO -{ - public interface IShortcutHandler - { - /// - /// Gets the extension. - /// - /// The extension. - string Extension { get; } - /// - /// Resolves the specified shortcut path. - /// - /// The shortcut path. - /// System.String. - string Resolve(string shortcutPath); - /// - /// Creates the specified shortcut path. - /// - /// The shortcut path. - /// The target path. - /// System.String. - void Create(string shortcutPath, string targetPath); - } -} diff --git a/MediaBrowser.Model/IO/IZipClient.cs b/MediaBrowser.Model/IO/IZipClient.cs deleted file mode 100644 index 4ebcba9d89..0000000000 --- a/MediaBrowser.Model/IO/IZipClient.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System.IO; - -namespace MediaBrowser.Model.IO -{ - /// - /// Interface IZipClient - /// - public interface IZipClient - { - /// - /// Extracts all. - /// - /// The source file. - /// The target path. - /// if set to true [overwrite existing files]. - void ExtractAll(string sourceFile, string targetPath, bool overwriteExistingFiles); - - /// - /// Extracts all. - /// - /// The source. - /// The target path. - /// if set to true [overwrite existing files]. - void ExtractAll(Stream source, string targetPath, bool overwriteExistingFiles); - - void ExtractAllFromGz(Stream source, string targetPath, bool overwriteExistingFiles); - void ExtractFirstFileFromGz(Stream source, string targetPath, string defaultFileName); - - /// - /// Extracts all from zip. - /// - /// The source. - /// The target path. - /// if set to true [overwrite existing files]. - void ExtractAllFromZip(Stream source, string targetPath, bool overwriteExistingFiles); - - /// - /// Extracts all from7z. - /// - /// The source file. - /// The target path. - /// if set to true [overwrite existing files]. - void ExtractAllFrom7z(string sourceFile, string targetPath, bool overwriteExistingFiles); - - /// - /// Extracts all from7z. - /// - /// The source. - /// The target path. - /// if set to true [overwrite existing files]. - void ExtractAllFrom7z(Stream source, string targetPath, bool overwriteExistingFiles); - - /// - /// Extracts all from tar. - /// - /// The source file. - /// The target path. - /// if set to true [overwrite existing files]. - void ExtractAllFromTar(string sourceFile, string targetPath, bool overwriteExistingFiles); - - /// - /// Extracts all from tar. - /// - /// The source. - /// The target path. - /// if set to true [overwrite existing files]. - void ExtractAllFromTar(Stream source, string targetPath, bool overwriteExistingFiles); - - /// - /// Extracts all from rar. - /// - /// The source file. - /// The target path. - /// if set to true [overwrite existing files]. - void ExtractAllFromRar(string sourceFile, string targetPath, bool overwriteExistingFiles); - - /// - /// Extracts all from rar. - /// - /// The source. - /// The target path. - /// if set to true [overwrite existing files]. - void ExtractAllFromRar(Stream source, string targetPath, bool overwriteExistingFiles); - } -} diff --git a/MediaBrowser.Model/IO/StreamDefaults.cs b/MediaBrowser.Model/IO/StreamDefaults.cs deleted file mode 100644 index 1e99ff4b55..0000000000 --- a/MediaBrowser.Model/IO/StreamDefaults.cs +++ /dev/null @@ -1,19 +0,0 @@ - -namespace MediaBrowser.Model.IO -{ - /// - /// Class StreamDefaults - /// - public static class StreamDefaults - { - /// - /// The default copy to buffer size - /// - public const int DefaultCopyToBufferSize = 81920; - - /// - /// The default file stream buffer size - /// - public const int DefaultFileStreamBufferSize = 81920; - } -} -- cgit v1.2.3