IWebDAVStoreCollection.cs 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using System.Collections.Generic;
  2. namespace WebDAVSharp.Server.Stores
  3. {
  4. /// <summary>
  5. /// This interface must be implemented by classes that operate as document collections in a store.
  6. /// </summary>
  7. public interface IWebDavStoreCollection : IWebDavStoreItem
  8. {
  9. /// <summary>
  10. /// Gets a collection of all the items in this <see cref="IWebDavStoreCollection" />.
  11. /// </summary>
  12. /// <value>
  13. /// The items.
  14. /// </value>
  15. IEnumerable<IWebDavStoreItem> Items { get; }
  16. /// <summary>
  17. /// Retrieves a store item by its name.
  18. /// </summary>
  19. /// <param name="name">The name of the store item to retrieve.</param>
  20. /// <returns>
  21. /// The store item that has the specified
  22. /// <paramref name="name" />;
  23. /// or
  24. /// <c>null</c> if there is no store item with that name.
  25. /// </returns>
  26. IWebDavStoreItem GetItemByName(string name);
  27. /// <summary>
  28. /// Creates a new collection with the specified name.
  29. /// </summary>
  30. /// <param name="name">The name of the new collection.</param>
  31. /// <returns>
  32. /// The created <see cref="IWebDavStoreCollection" /> instance.
  33. /// </returns>
  34. IWebDavStoreCollection CreateCollection(string name);
  35. /// <summary>
  36. /// Deletes a store item by its name.
  37. /// </summary>
  38. /// <param name="item">The name of the store item to delete.</param>
  39. void Delete(IWebDavStoreItem item);
  40. /// <summary>
  41. /// Creates a new document with the specified name.
  42. /// </summary>
  43. /// <param name="name">The name of the new document.</param>
  44. /// <returns>
  45. /// The created <see cref="IWebDavStoreDocument" /> instance.
  46. /// </returns>
  47. IWebDavStoreDocument CreateDocument(string name);
  48. /// <summary>
  49. /// Copies an existing store item into this collection, overwriting any existing items.
  50. /// </summary>
  51. /// <param name="source">The store item to copy from.</param>
  52. /// <param name="destinationName">The name of the copy to create of <paramref name="source" />.</param>
  53. /// <param name="includeContent">The boolean for copying the containing files/folders or not.</param>
  54. /// <returns>
  55. /// The created <see cref="IWebDavStoreItem" /> instance.
  56. /// </returns>
  57. IWebDavStoreItem CopyItemHere(IWebDavStoreItem source, string destinationName, bool includeContent);
  58. /// <summary>
  59. /// Moves an existing store item into this collection, overwriting any existing items.
  60. /// </summary>
  61. /// <param name="source">The store item to move.</param>
  62. /// <param name="destinationName">
  63. /// The
  64. /// <see cref="IWebDavStoreItem" /> that refers to the item that was moved,
  65. /// in its new location.
  66. /// </param>
  67. /// <returns>
  68. /// The moved <see cref="IWebDavStoreItem" /> instance.
  69. /// </returns>
  70. /// <remarks>
  71. /// Note that the method should fail without creating or overwriting content in the
  72. /// target collection if the move cannot go through.
  73. /// </remarks>
  74. IWebDavStoreItem MoveItemHere(IWebDavStoreItem source, string destinationName);
  75. }
  76. }