WebDavRamfsStoreItem.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System;
  2. using WebDAVSharp.Server.Stores;
  3. namespace RamDavisk.Ramfs
  4. {
  5. internal abstract class WebDavRamfsStoreItem : IWebDavStoreItem, IDisposable
  6. {
  7. protected WebDavRamfsStoreItem()
  8. {
  9. CreationDate = DateTime.Now;
  10. ModificationDate = CreationDate;
  11. }
  12. // hold
  13. IWebDavStoreCollection IWebDavStoreItem.ParentCollection => ParentCollection;
  14. public string ItemPath => (ParentCollection?.ItemPath ?? "") + "/" + Name;
  15. public WebDavRamfsStoreCollection ParentCollection { get; set; }
  16. public string Name { get; set; } = "";
  17. public DateTime CreationDate { get; }
  18. public DateTime ModificationDate { get; protected set; }
  19. // abstr
  20. public abstract long Size { get; }
  21. public abstract bool IsCollection { get; }
  22. public abstract string Etag { get; }
  23. //virtual
  24. public virtual void Dispose()
  25. {
  26. }
  27. // unused
  28. public Uri Href { get; set; }
  29. public string MimeType { get; }
  30. public IWebDavStore Store { get; }
  31. public Guid GetRepl_uId()
  32. {
  33. return new Guid();
  34. }
  35. public IWebDavFileInfo GetFileInfo()
  36. {
  37. return new WebDavRamfsStoreFileInfo()
  38. {
  39. };
  40. }
  41. }
  42. }