Loading...
Searching...
No Matches
FileLocationHandler::AbstractFileLocationHandler Class Referenceabstract

The abstract file location handler class. More...

`#include <FileLocationHandler.qc.dox.h>`

Inheritance diagram for FileLocationHandler::AbstractFileLocationHandler:
[legend]

## Public Member Functions

binary | getBinaryFile (string scheme, string location, *hash< auto > opts)
| Retrieves a binary file from the given location.
Qore::InputStream | getBinaryStream (string scheme, string location, *hash< auto > opts)
| Retrieves a binary file from the given location.
OutputStreamWrapper | getOutputStream (string scheme, string location, *hash< auto > opts)
| Returns an output stream for writing data to the given location.
hash< string, hash< FileHandlerOptionInfo > > | getReadOptions ()
| Gets supported read options.
Qore::StreamReader | getStreamReader (string scheme, string location, *hash< auto > opts)
| Returns a string stream for the file's data at the given location.
string | getTextFile (string scheme, string location, *hash< auto > opts)
| Retrieves a text file from the given location.
hash< string, hash< FileHandlerOptionInfo > > | getWriteOptions ()
| Gets supported write options.
| writeFile (string scheme, string location, data contents, *hash< auto > opts)
| Writes data to a file at the given location.

## Protected Member Functions

abstract binary | getBinaryFileImpl (string scheme, string location, *hash< auto > opts)
| Retrieves a binary file from the given location.
abstract Qore::InputStream | getBinaryStreamImpl (string scheme, string location, *hash< auto > opts)
| Retrieves a binary file from the given location.
abstract OutputStreamWrapper | getOutputStreamImpl (string scheme, string location, *hash< auto > opts)
| Returns an output stream for writing data to the given location.
abstract hash< string, hash< FileHandlerOptionInfo > > | getReadOptionsImpl ()
| Gets supported read options.
abstract Qore::StreamReader | getStreamReaderImpl (string scheme, string location, *hash< auto > opts)
| Returns a string stream for the file's data at the given location.
abstract string | getTextFileImpl (string scheme, string location, *hash< auto > opts)
| Retrieves a text file from the given location.
abstract hash< string, hash< FileHandlerOptionInfo > > | getWriteOptionsImpl ()
| Gets supported write options.
abstract | writeFileImpl (string scheme, string location, data contents, *hash< auto > opts)
| Writes data to a file at the given location.

## Static Protected Member Functions

static string | forceEncoding (string str, *string encoding)
| Returns a string tagged with the given encoding, if any.

## Detailed Description

The abstract file location handler class.

## Member Function Documentation

## getBinaryFile()

binary FileLocationHandler::AbstractFileLocationHandler::getBinaryFile | ( | string | scheme,
|  | string | location,
|  | *hash< auto > | opts
| ) |  |

Retrieves a binary file from the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme
  opts | read options

Returns
  the binary data of the file's contents, if it can be retrieved

## getBinaryFileImpl()

abstract binary FileLocationHandler::AbstractFileLocationHandler::getBinaryFileImpl | ( | string | scheme,
|  | string | location,
|  | *hash< auto > | opts
| ) |  |

protectedpure virtual

Retrieves a binary file from the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme
  opts | read options

Returns
  the binary data of the file's contents, if it can be retrieved

Implemented in FileLocationHandler::FileLocationHandlerData, FileLocationHandler::FileLocationHandlerFile, FileLocationHandler::FileLocationHandlerFtp, FileLocationHandler::FileLocationHandlerHttp, FileLocationHandler::FileLocationHandlerRest, and FileLocationHandler::FileLocationHandlerSftp.

## getBinaryStream()

Qore::InputStream FileLocationHandler::AbstractFileLocationHandler::getBinaryStream | ( | string | scheme,
|  | string | location,
|  | *hash< auto > | opts
| ) |  |

Retrieves a binary file from the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme
  opts | read options

Returns
  an input stream of the file's contents, if it can be retrieved

Note
  The data is read in the background and added to the input stream

## getBinaryStreamImpl()

abstract Qore::InputStream FileLocationHandler::AbstractFileLocationHandler::getBinaryStreamImpl | ( | string | scheme,
|  | string | location,
|  | *hash< auto > | opts
| ) |  |

protectedpure virtual

Retrieves a binary file from the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme
  opts | read options

Returns
  an input stream of the file's contents, if it can be retrieved

Implemented in FileLocationHandler::FileLocationHandlerData, FileLocationHandler::FileLocationHandlerFile, FileLocationHandler::FileLocationHandlerFtp, FileLocationHandler::FileLocationHandlerHttp, FileLocationHandler::FileLocationHandlerRest, and FileLocationHandler::FileLocationHandlerSftp.

## getOutputStream()

OutputStreamWrapper FileLocationHandler::AbstractFileLocationHandler::getOutputStream | ( | string | scheme,
|  | string | location,
|  | *hash< auto > | opts
| ) |  |

Returns an output stream for writing data to the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme
  opts | write options

Returns
  an output stream for writing to the file

Note
  - OutputStreamWrapper::close() must be called to close the stream after writing terminates in order to avoid a deadlock
  - The data written to the OutputStreamWrapper object may be written in the background; to ensure that the data has been written to the target, call OutputStreamWrapper::waitForIo()

## getOutputStreamImpl()

abstract OutputStreamWrapper FileLocationHandler::AbstractFileLocationHandler::getOutputStreamImpl | ( | string | scheme,
|  | string | location,
|  | *hash< auto > | opts
| ) |  |

protectedpure virtual

Returns an output stream for writing data to the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme
  opts | write options

Returns
  an output stream for writing to the file

Note
  - OutputStreamWrapper::close() must be called to close the stream after writing terminates in order to avoid a deadlock
  - The data written to the OutputStreamWrapper object may be written in the background; to ensure that the data has been written to the target, call OutputStreamWrapper::waitForIo()

Implemented in FileLocationHandler::FileLocationHandlerData, FileLocationHandler::FileLocationHandlerFile, FileLocationHandler::FileLocationHandlerFtp, FileLocationHandler::FileLocationHandlerHttp, FileLocationHandler::FileLocationHandlerRest, and FileLocationHandler::FileLocationHandlerSftp.

## getReadOptions()

hash< string, hash< FileHandlerOptionInfo > > FileLocationHandler::AbstractFileLocationHandler::getReadOptions | ( |  | ) |

Gets supported read options.

Returns
  supported read options

## getReadOptionsImpl()

abstract hash< string, hash< FileHandlerOptionInfo > > FileLocationHandler::AbstractFileLocationHandler::getReadOptionsImpl | ( |  | ) |

protectedpure virtual

Gets supported read options.

Returns
  supported read options

Implemented in FileLocationHandler::FileLocationHandlerData, FileLocationHandler::FileLocationHandlerFile, FileLocationHandler::FileLocationHandlerFtp, FileLocationHandler::FileLocationHandlerHttp, FileLocationHandler::FileLocationHandlerRest, and FileLocationHandler::FileLocationHandlerSftp.

## getStreamReader()

Qore::StreamReader FileLocationHandler::AbstractFileLocationHandler::getStreamReader | ( | string | scheme,
|  | string | location,
|  | *hash< auto > | opts
| ) |  |

Returns a string stream for the file's data at the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme
  opts | read options

Returns
  a stream reader for the file's contents, if it can be retrieved

Note
  The data is read in the background and added to the input stream backing the stream reader

## getStreamReaderImpl()

abstract Qore::StreamReader FileLocationHandler::AbstractFileLocationHandler::getStreamReaderImpl | ( | string | scheme,
|  | string | location,
|  | *hash< auto > | opts
| ) |  |

protectedpure virtual

Returns a string stream for the file's data at the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme
  opts | read options

Returns
  a stream reader for the file's contents, if it can be retrieved

Implemented in FileLocationHandler::FileLocationHandlerData, FileLocationHandler::FileLocationHandlerFile, FileLocationHandler::FileLocationHandlerFtp, FileLocationHandler::FileLocationHandlerHttp, FileLocationHandler::FileLocationHandlerRest, and FileLocationHandler::FileLocationHandlerSftp.

## getTextFile()

string FileLocationHandler::AbstractFileLocationHandler::getTextFile | ( | string | scheme,
|  | string | location,
|  | *hash< auto > | opts
| ) |  |

Retrieves a text file from the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme or options
  opts | read options

Returns
  the string of the file's contents, if it can be retrieved

## getTextFileImpl()

abstract string FileLocationHandler::AbstractFileLocationHandler::getTextFileImpl | ( | string | scheme,
|  | string | location,
|  | *hash< auto > | opts
| ) |  |

protectedpure virtual

Retrieves a text file from the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme
  opts | read options

Returns
  the string of the file's contents, if it can be retrieved

Implemented in FileLocationHandler::FileLocationHandlerData, FileLocationHandler::FileLocationHandlerFile, FileLocationHandler::FileLocationHandlerFtp, FileLocationHandler::FileLocationHandlerHttp, FileLocationHandler::FileLocationHandlerRest, and FileLocationHandler::FileLocationHandlerSftp.

## getWriteOptions()

hash< string, hash< FileHandlerOptionInfo > > FileLocationHandler::AbstractFileLocationHandler::getWriteOptions | ( |  | ) |

Gets supported write options.

Returns
  supported write options

## getWriteOptionsImpl()

abstract hash< string, hash< FileHandlerOptionInfo > > FileLocationHandler::AbstractFileLocationHandler::getWriteOptionsImpl | ( |  | ) |

protectedpure virtual

Gets supported write options.

Returns
  supported write options

Implemented in FileLocationHandler::FileLocationHandlerData, FileLocationHandler::FileLocationHandlerFile, FileLocationHandler::FileLocationHandlerFtp, FileLocationHandler::FileLocationHandlerHttp, FileLocationHandler::FileLocationHandlerRest, and FileLocationHandler::FileLocationHandlerSftp.

## writeFile()

FileLocationHandler::AbstractFileLocationHandler::writeFile | ( | string | scheme,
|  | string | location,
|  | data | contents,
|  | *hash< auto > | opts
| ) |  |

Writes data to a file at the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme
  contents | the file's contents
  opts | write options

## writeFileImpl()

abstract FileLocationHandler::AbstractFileLocationHandler::writeFileImpl | ( | string | scheme,
|  | string | location,
|  | data | contents,
|  | *hash< auto > | opts
| ) |  |

protectedpure virtual

Writes data to a file at the given location.

Parameters

  scheme | the scheme being used
  location | the location string without the scheme
  contents | the file's contents
  opts | write options

Implemented in FileLocationHandler::FileLocationHandlerData, FileLocationHandler::FileLocationHandlerFile, FileLocationHandler::FileLocationHandlerFtp, FileLocationHandler::FileLocationHandlerHttp, FileLocationHandler::FileLocationHandlerRest, and FileLocationHandler::FileLocationHandlerSftp.