PosixRenameRequest.cs 1008 B

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using Renci.SshNet.Sftp.Responses;
  3. namespace Renci.SshNet.Sftp.Requests
  4. {
  5. internal class PosixRenameRequest : SftpRequest
  6. {
  7. public const string NAME = "posix-rename@openssh.com";
  8. public override SftpMessageTypes SftpMessageType
  9. {
  10. get { return SftpMessageTypes.Extended; }
  11. }
  12. public string OldPath { get; private set; }
  13. public string NewPath { get; private set; }
  14. public PosixRenameRequest(uint protocolVersion, uint requestId, string oldPath, string newPath, Action<SftpStatusResponse> statusAction)
  15. : base(protocolVersion, requestId, statusAction)
  16. {
  17. this.OldPath = oldPath;
  18. this.NewPath = newPath;
  19. }
  20. protected override void SaveData()
  21. {
  22. base.SaveData();
  23. this.Write(PosixRenameRequest.NAME);
  24. this.Write(this.OldPath);
  25. this.Write(this.NewPath);
  26. }
  27. }
  28. }