IFileSystem.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. namespace Utilities
  5. {
  6. public interface IFileSystem
  7. {
  8. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  9. /// <exception cref="System.IO.FileNotFoundException"></exception>
  10. /// <exception cref="System.IO.IOException"></exception>
  11. /// <exception cref="System.UnauthorizedAccessException"></exception>
  12. FileSystemEntry GetEntry(string path);
  13. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  14. /// <exception cref="System.IO.IOException"></exception>
  15. /// <exception cref="System.UnauthorizedAccessException"></exception>
  16. FileSystemEntry CreateFile(string path);
  17. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  18. /// <exception cref="System.IO.IOException"></exception>
  19. /// <exception cref="System.UnauthorizedAccessException"></exception>
  20. FileSystemEntry CreateDirectory(string path);
  21. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  22. /// <exception cref="System.IO.FileNotFoundException"></exception>
  23. /// <exception cref="System.IO.IOException"></exception>
  24. /// <exception cref="System.UnauthorizedAccessException"></exception>
  25. void Move(string source, string destination);
  26. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  27. /// <exception cref="System.IO.FileNotFoundException"></exception>
  28. /// <exception cref="System.IO.IOException"></exception>
  29. /// <exception cref="System.UnauthorizedAccessException"></exception>
  30. void Delete(string path);
  31. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  32. /// <exception cref="System.IO.IOException"></exception>
  33. /// <exception cref="System.UnauthorizedAccessException"></exception>
  34. List<FileSystemEntry> ListEntriesInDirectory(string path);
  35. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  36. /// <exception cref="System.IO.FileNotFoundException"></exception>
  37. /// <exception cref="System.IO.IOException"></exception>
  38. /// <exception cref="System.UnauthorizedAccessException"></exception>
  39. List<KeyValuePair<string, ulong>> ListDataStreams(string path);
  40. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  41. /// <exception cref="System.IO.FileNotFoundException"></exception>
  42. /// <exception cref="System.IO.IOException"></exception>
  43. /// <exception cref="System.UnauthorizedAccessException"></exception>
  44. Stream OpenFile(string path, FileMode mode, FileAccess access, FileShare share, FileOptions options);
  45. /// <exception cref="System.IO.FileNotFoundException"></exception>
  46. /// <exception cref="System.IO.IOException"></exception>
  47. /// <exception cref="System.UnauthorizedAccessException"></exception>
  48. void SetAttributes(string path, bool? isHidden, bool? isReadonly, bool? isArchived);
  49. /// <exception cref="System.IO.FileNotFoundException"></exception>
  50. /// <exception cref="System.IO.IOException"></exception>
  51. /// <exception cref="System.UnauthorizedAccessException"></exception>
  52. void SetDates(string path, DateTime? creationDT, DateTime? lastWriteDT, DateTime? lastAccessDT);
  53. string Name
  54. {
  55. get;
  56. }
  57. /// <exception cref="System.IO.IOException"></exception>
  58. long Size
  59. {
  60. get;
  61. }
  62. /// <exception cref="System.IO.IOException"></exception>
  63. long FreeSpace
  64. {
  65. get;
  66. }
  67. /// <summary>
  68. /// Indicates support for opening named streams (alternate data streams).
  69. /// Named streams are opened using the filename:stream syntax.
  70. /// </summary>
  71. bool SupportsNamedStreams
  72. {
  73. get;
  74. }
  75. }
  76. }