VirtualFileLocalResponseInterface

class kanzi::connect::VirtualFileLocalResponseInterface

Defines an interface for local virtual file responses.

Subclassed by VirtualFileService

Public Functions

inline virtual ~VirtualFileLocalResponseInterface()

Virtual destructor.

virtual void provideAsFileThroughHttp(VirtualFileWorkItemSharedPtr workItem, const string &filepath) = 0

Provide response as a path to existing file.

Parameters
  • workItem – where to store the data

  • filepath – full path to local file

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

Provide requested file as inline content through HTTP.

Parameters
  • workItem – where to store the data

  • mime – mime type of the data

  • blob – binary data buffer

  • length – size of binary data buffer

virtual void provideAsRedirectUri(VirtualFileWorkItemSharedPtr workItem, const string &redirecturi) = 0

Provide response as HTTP redirect.

Parameters
  • workItem – where to store the data

  • redirectUri – Address where to redirect the client to.

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

Provide response as file contents through the connection adapters.

Parameters
  • uri – Identifies the file

  • buffer – The data to provide

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

Returns

bool indicating whether file transfer was initiated.