#pragma warning disable CS1591 using System; using System.Collections.Generic; namespace MediaBrowser.Model.IO { /// /// Interface IFileSystem. /// public interface IFileSystem { /// /// 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); string MakeAbsolutePath(string folderPath, string filePath); /// /// Moves a directory to a new location. /// /// Source directory. /// Destination directory. void MoveDirectory(string source, string destination); /// /// 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); /// /// 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); /// /// Gets the file name without extension. /// /// The information. /// System.String. string GetFileNameWithoutExtension(FileSystemMetadata info); /// /// 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); /// /// Gets the directories. /// /// The path. /// If set to true also searches in subdirectiories. /// All found directories. IEnumerable GetDirectories(string path, bool recursive = false); /// /// Gets the files. /// /// The path in which to search. /// If set to true also searches in subdirectiories. /// All found files. IEnumerable GetFiles(string path, bool recursive = false); IEnumerable GetFiles(string path, IReadOnlyList? 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); /// /// 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 SetAttributes(string path, bool isHidden, bool readOnly); IEnumerable GetDrives(); /// /// Determines whether the directory exists. /// /// The path. /// Whether the path exists. bool DirectoryExists(string path); /// /// Determines whether the file exists. /// /// The path. /// Whether the path exists. bool FileExists(string path); } }