RealPathHandler Class

[C++]

class RealPathHandler : public HandlerBase (.. public RefCountable, public NoCopy)
{
public:
  bool Success() const;
  std::wstring GetRealPath() const;
  SftpErr GetError() const;

protected:
  virtual void OnStart();
  virtual void OnDone();
  virtual void OnRealPath(std::wstring const& realPath);
  virtual void OnError(SftpErr const& error);
}

[C#]

public class RealPathHandler : IDisposable, HandlerBase (.. WaitImpl)
{
  public bool Success { get; }
  public string GetRealPath();
  public SftpErr GetError();
  
  public event StartEventHandler OnStart;
  public event DoneEventHandler OnDone;
  public event RealPathEventHandler OnRealPath;
  public event SftpErrorEventHandler OnError;
  
  public override sealed bool IsDisposed { get; }
  public override sealed void Dispose();
}

Members

General

  • Success: Request completed successfully?
  • GetRealPath: Returns the resulting absolute path with a leading slash ("/").
  • GetError: Returns a SftpErr.

Overrides and Events

  • OnStart: The first override/event being invoked for a request. *
  • OnDone: The last override/event being invoked for a request. *
  • OnRealPath: Invoked to inform you about the resulting absolute path.
    Parameters:
    • realPath: See GetRealPath().
  • OnError: Invoked for a failed request.
    Parameters:
    • error: See GetError().

[.NET] Disposing

  • IsDisposed: Is the object disposed?
  • Dispose: Release all resources used by the object.

Remarks

RealPathHandler is a base class which must be derived to use. Either derive and implement your own OnDone() method, or use pre-made derived classes RealPathEvent or RealPathMsg (for Win32 graphical applications). If you use RealPathEvent, call WaitDone() or wait for GetDoneEvent() before checking the result.

This handler is used with with the [ClientSftpChannel]RealPath request.

* [C++] Always call the base class implementation from your override.