IFileSystem.cs 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.ArgumentException"></exception>
  9. /// <exception cref="System.IO.IOException"></exception>
  10. /// <exception cref="System.UnauthorizedAccessException"></exception>
  11. IFileSystemEntry GetEntry(string path);
  12. /// <exception cref="System.ArgumentException"></exception>
  13. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  14. /// <exception cref="System.IO.IOException"></exception>
  15. /// <exception cref="System.UnauthorizedAccessException"></exception>
  16. IFileSystemEntry CreateFile(string path);
  17. /// <exception cref="System.ArgumentException"></exception>
  18. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  19. /// <exception cref="System.IO.IOException"></exception>
  20. /// <exception cref="System.UnauthorizedAccessException"></exception>
  21. IFileSystemEntry CreateDirectory(string path);
  22. /// <exception cref="System.ArgumentException"></exception>
  23. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  24. /// <exception cref="System.IO.FileNotFoundException"></exception>
  25. /// <exception cref="System.IO.IOException"></exception>
  26. /// <exception cref="System.UnauthorizedAccessException"></exception>
  27. void Move(string source, string destination);
  28. /// <exception cref="System.ArgumentException"></exception>
  29. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  30. /// <exception cref="System.IO.FileNotFoundException"></exception>
  31. /// <exception cref="System.IO.IOException"></exception>
  32. /// <exception cref="System.UnauthorizedAccessException"></exception>
  33. void Delete(string path);
  34. /// <exception cref="System.ArgumentException"></exception>
  35. /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
  36. /// <exception cref="System.IO.IOException"></exception>
  37. /// <exception cref="System.UnauthorizedAccessException"></exception>
  38. List<IFileSystemEntry> ListEntriesInDirectory(string path);
  39. /// <exception cref="System.ArgumentException"></exception>
  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.ArgumentException"></exception>
  46. /// <exception cref="System.IO.FileNotFoundException"></exception>
  47. /// <exception cref="System.IO.IOException"></exception>
  48. /// <exception cref="System.UnauthorizedAccessException"></exception>
  49. void SetAttributes(string path, bool? isHidden, bool? isReadonly, bool? isArchived);
  50. /// <exception cref="System.ArgumentException"></exception>
  51. /// <exception cref="System.IO.FileNotFoundException"></exception>
  52. /// <exception cref="System.IO.IOException"></exception>
  53. /// <exception cref="System.UnauthorizedAccessException"></exception>
  54. void SetDates(string path, DateTime? creationDT, DateTime? lastWriteDT, DateTime? lastAccessDT);
  55. string Name
  56. {
  57. get;
  58. }
  59. /// <exception cref="System.IO.IOException"></exception>
  60. long Size
  61. {
  62. get;
  63. }
  64. /// <exception cref="System.IO.IOException"></exception>
  65. long FreeSpace
  66. {
  67. get;
  68. }
  69. }
  70. }