IFileSystem.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using System.IO;
  3. namespace MediaBrowser.Common.IO
  4. {
  5. /// <summary>
  6. /// Interface IFileSystem
  7. /// </summary>
  8. public interface IFileSystem
  9. {
  10. /// <summary>
  11. /// Determines whether the specified filename is shortcut.
  12. /// </summary>
  13. /// <param name="filename">The filename.</param>
  14. /// <returns><c>true</c> if the specified filename is shortcut; otherwise, <c>false</c>.</returns>
  15. bool IsShortcut(string filename);
  16. /// <summary>
  17. /// Resolves the shortcut.
  18. /// </summary>
  19. /// <param name="filename">The filename.</param>
  20. /// <returns>System.String.</returns>
  21. string ResolveShortcut(string filename);
  22. /// <summary>
  23. /// Creates the shortcut.
  24. /// </summary>
  25. /// <param name="shortcutPath">The shortcut path.</param>
  26. /// <param name="target">The target.</param>
  27. void CreateShortcut(string shortcutPath, string target);
  28. /// <summary>
  29. /// Gets the file system info.
  30. /// </summary>
  31. /// <param name="path">The path.</param>
  32. /// <returns>FileSystemInfo.</returns>
  33. FileSystemInfo GetFileSystemInfo(string path);
  34. /// <summary>
  35. /// Gets the valid filename.
  36. /// </summary>
  37. /// <param name="filename">The filename.</param>
  38. /// <returns>System.String.</returns>
  39. string GetValidFilename(string filename);
  40. /// <summary>
  41. /// Gets the creation time UTC.
  42. /// </summary>
  43. /// <param name="info">The info.</param>
  44. /// <returns>DateTime.</returns>
  45. DateTime GetCreationTimeUtc(FileSystemInfo info);
  46. /// <summary>
  47. /// Gets the last write time UTC.
  48. /// </summary>
  49. /// <param name="info">The information.</param>
  50. /// <returns>DateTime.</returns>
  51. DateTime GetLastWriteTimeUtc(FileSystemInfo info);
  52. /// <summary>
  53. /// Gets the last write time UTC.
  54. /// </summary>
  55. /// <param name="path">The path.</param>
  56. /// <returns>DateTime.</returns>
  57. DateTime GetLastWriteTimeUtc(string path);
  58. /// <summary>
  59. /// Gets the file stream.
  60. /// </summary>
  61. /// <param name="path">The path.</param>
  62. /// <param name="mode">The mode.</param>
  63. /// <param name="access">The access.</param>
  64. /// <param name="share">The share.</param>
  65. /// <param name="isAsync">if set to <c>true</c> [is asynchronous].</param>
  66. /// <returns>FileStream.</returns>
  67. FileStream GetFileStream(string path, FileMode mode, FileAccess access, FileShare share, bool isAsync = false);
  68. }
  69. }