IServerSyncProvider.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using MediaBrowser.Model.Sync;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. namespace MediaBrowser.Controller.Sync
  8. {
  9. public interface IServerSyncProvider : ISyncProvider
  10. {
  11. /// <summary>
  12. /// Transfers the file.
  13. /// </summary>
  14. /// <param name="stream">The stream.</param>
  15. /// <param name="remotePath">The remote path.</param>
  16. /// <param name="target">The target.</param>
  17. /// <param name="progress">The progress.</param>
  18. /// <param name="cancellationToken">The cancellation token.</param>
  19. /// <returns>Task.</returns>
  20. Task<SyncedFileInfo> SendFile(Stream stream, string remotePath, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
  21. /// <summary>
  22. /// Deletes the file.
  23. /// </summary>
  24. /// <param name="path">The path.</param>
  25. /// <param name="target">The target.</param>
  26. /// <param name="cancellationToken">The cancellation token.</param>
  27. /// <returns>Task.</returns>
  28. Task DeleteFile(string path, SyncTarget target, CancellationToken cancellationToken);
  29. /// <summary>
  30. /// Gets the file.
  31. /// </summary>
  32. /// <param name="path">The path.</param>
  33. /// <param name="target">The target.</param>
  34. /// <param name="progress">The progress.</param>
  35. /// <param name="cancellationToken">The cancellation token.</param>
  36. /// <returns>Task&lt;Stream&gt;.</returns>
  37. Task<Stream> GetFile(string path, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
  38. /// <summary>
  39. /// Gets the full path.
  40. /// </summary>
  41. /// <param name="path">The path.</param>
  42. /// <param name="target">The target.</param>
  43. /// <returns>System.String.</returns>
  44. string GetFullPath(IEnumerable<string> path, SyncTarget target);
  45. /// <summary>
  46. /// Gets the parent directory path.
  47. /// </summary>
  48. /// <param name="path">The path.</param>
  49. /// <param name="target">The target.</param>
  50. /// <returns>System.String.</returns>
  51. string GetParentDirectoryPath(string path, SyncTarget target);
  52. }
  53. }