SftpReadLinkRequest.cs 990 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Renci.SshNet.Sftp.Responses;
  6. namespace Renci.SshNet.Sftp.Requests
  7. {
  8. internal class SftpReadLinkRequest : SftpRequest
  9. {
  10. public override SftpMessageTypes SftpMessageType
  11. {
  12. get { return SftpMessageTypes.ReadLink; }
  13. }
  14. public string Path { get; private set; }
  15. public SftpReadLinkRequest(uint requestId, string path, Action<SftpNameResponse> nameAction, Action<SftpStatusResponse> statusAction)
  16. : base(requestId, statusAction)
  17. {
  18. this.Path = path;
  19. this.SetAction(nameAction);
  20. }
  21. protected override void LoadData()
  22. {
  23. base.LoadData();
  24. this.Path = this.ReadString();
  25. }
  26. protected override void SaveData()
  27. {
  28. base.SaveData();
  29. this.Write(this.Path);
  30. }
  31. }
  32. }