VirtualFileRemoteResponseInterface

class kanzi::connect::VirtualFileRemoteResponseInterface

Defines an interface for virtual file remote responses.

Public Functions

inline virtual ~VirtualFileRemoteResponseInterface()

Virtual destructor.

virtual void provideAsFileThroughHttp(int handle, const string &filepath) = 0

Provide requested file as existing file in filesystem through http protocol.

Parameters
  • handle – value provided in request

  • filepath – full path to file to provide

virtual void provideAsHttpContent(int handle, const string &mime, const unsigned char *blob, size_t length) = 0

Provide requested file as inline content through http.

Parameters
  • handle – value provided in request

  • mime – mime type of the provided content

  • blob – The content.

  • length – size of the content in bytes.

virtual void provideAsRedirectUri(int handle, const string &uri) = 0

Provide requested file as HTTP redirect request.

Parameters
  • handle – value provided in request

  • uri – unique resource identifier where to redirect the client.

virtual bool provideFileDirectly(int handle, const string &uri, vector<char> &buffer, const unsigned int blockSize) = 0

Provide response as file contents through the connection adapters.

Parameters
  • handle – The value provided in the request.

  • uri – The file path to requested file.

  • buffer – The data to provide.

  • blockSize – Defines the size chunks in which to send the file contents.

Returns

Indicates whether file transfer was initiated.