From 6c8d9192985036acb3d1fe626ed57980bb862d6a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 31 Oct 2013 10:03:23 -0400 Subject: replace file system calls with IFileSystem when needed --- MediaBrowser.Common/IO/IFileSystem.cs | 78 +++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 MediaBrowser.Common/IO/IFileSystem.cs (limited to 'MediaBrowser.Common/IO/IFileSystem.cs') diff --git a/MediaBrowser.Common/IO/IFileSystem.cs b/MediaBrowser.Common/IO/IFileSystem.cs new file mode 100644 index 000000000..d307b74e5 --- /dev/null +++ b/MediaBrowser.Common/IO/IFileSystem.cs @@ -0,0 +1,78 @@ +using System; +using System.IO; + +namespace MediaBrowser.Common.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); + + /// + /// Gets the file system info. + /// + /// The path. + /// FileSystemInfo. + FileSystemInfo GetFileSystemInfo(string path); + + /// + /// Gets the valid filename. + /// + /// The filename. + /// System.String. + string GetValidFilename(string filename); + + /// + /// Gets the creation time UTC. + /// + /// The info. + /// DateTime. + DateTime GetCreationTimeUtc(FileSystemInfo info); + + /// + /// Gets the last write time UTC. + /// + /// The information. + /// DateTime. + DateTime GetLastWriteTimeUtc(FileSystemInfo 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. + FileStream GetFileStream(string path, FileMode mode, FileAccess access, FileShare share, bool isAsync = false); + } +} -- cgit v1.2.3