WebDAVUnlockMethodHandler.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System.Collections.Generic;
  2. using System.Net;
  3. using Mtp2Dav.WebDAVSharp.Server._1d2086a502937936ebc6bfe19cfa15d855be1c31.Adapters;
  4. using Mtp2Dav.WebDAVSharp.Server._1d2086a502937936ebc6bfe19cfa15d855be1c31.Stores;
  5. namespace Mtp2Dav.WebDAVSharp.Server._1d2086a502937936ebc6bfe19cfa15d855be1c31.MethodHandlers
  6. {
  7. /// <summary>
  8. /// This class implements the <c>PUT</c> HTTP method for WebDAV#.
  9. /// </summary>
  10. internal class WebDavUnlockMethodHandler : WebDavMethodHandlerBase, IWebDavMethodHandler
  11. {
  12. /// <summary>
  13. /// Gets the collection of the names of the HTTP methods handled by this instance.
  14. /// </summary>
  15. /// <value>
  16. /// The names.
  17. /// </value>
  18. public IEnumerable<string> Names => new[]
  19. {
  20. "UNLOCK"
  21. };
  22. /// <summary>
  23. /// Processes the request.
  24. /// </summary>
  25. /// <param name="server">The <see cref="WebDavServer" /> through which the request came in from the client.</param>
  26. /// <param name="context">
  27. /// The
  28. /// <see cref="IHttpListenerContext" /> object containing both the request and response
  29. /// objects to use.
  30. /// </param>
  31. /// <param name="store">The <see cref="IWebDavStore" /> that the <see cref="WebDavServer" /> is hosting.</param>
  32. public void ProcessRequest(WebDavServer server, IHttpListenerContext context, IWebDavStore store)
  33. {
  34. // Get the parent collection of the item
  35. var collection = GetParentCollection(server, store, context.Request.Url);
  36. // Get the item from the collection
  37. var item = GetItemFromCollection(collection, context.Request.Url);
  38. /***************************************************************************************************
  39. * Send the response
  40. ***************************************************************************************************/
  41. context.SendSimpleResponse(HttpStatusCode.NoContent);
  42. }
  43. }
  44. }