Qore FileLocationHandler Module Reference 2.3
Loading...
Searching...
No Matches
FileLocationHandler::FileLocationHandlerRest Class Reference

The class for handling "rest(s)://"" locations. More...

#include <FileLocationHandlerRest.qc.dox.h>

Inheritance diagram for FileLocationHandler::FileLocationHandlerRest:
[legend]

Public Attributes

const RestClientLocationOpts
 Valid REST location options. More...
 

Private Member Methods

binary getBinaryFileImpl (string scheme, string location, *hash< auto > opts)
 Retrieves a binary file from the given location. More...
 
Qore::InputStream getBinaryStreamImpl (string scheme, string location, *hash< auto > opts)
 Retrieves a binary file from the given location. More...
 
Qore::AbstractPollOperation getIoPollerForLocationImpl (string scheme, string location, *hash< auto > opts)
 Retrieves an I/O poller to retrieve a binary file from the given location. More...
 
OutputStreamWrapper getOutputStreamImpl (string scheme, string location, *hash< auto > opts)
 This method only throws a STREAM-WRITE-ERROR exception. More...
 
hash< string, hash< FileHandlerOptionInfo > > getReadOptionsImpl ()
 Gets supported read options. More...
 
object getRestClient (string scheme, string location, *hash< auto > opts, reference< string > path, bool do_connect=True)
 Returns a RestClient object for the given location. More...
 
Qore::StreamReader getStreamReaderImpl (string scheme, string location, *hash< auto > opts)
 Returns a stream reader for the file's data at the given location. More...
 
string getTextFileImpl (string scheme, string location, *hash< auto > opts)
 Retrieves a text file from the given location. More...
 
hash< string, hash< FileHandlerOptionInfo > > getWriteOptionsImpl ()
 Gets supported write options. More...
 
 writeFileImpl (string scheme, string location, data contents, *hash< auto > opts)
 Writes data to a file at the given location. More...
 
abstract binary getBinaryFileImpl (string scheme, string location, *hash< auto > opts)
 Retrieves a binary file from the given location. More...
 
abstract Qore::InputStream getBinaryStreamImpl (string scheme, string location, *hash< auto > opts)
 Retrieves a binary file from the given location. More...
 
abstract Qore::AbstractPollOperation getIoPollerForLocationImpl (string scheme, string location, *hash< auto > opts)
 Retrieves an I/O poller to retrieve a binary file from the given location. More...
 
abstract OutputStreamWrapper getOutputStreamImpl (string scheme, string location, *hash< auto > opts)
 Returns an output stream for writing data to the given location. More...
 
abstract hash< string, hash< FileHandlerOptionInfo > > getReadOptionsImpl ()
 Gets supported read options. More...
 
abstract Qore::StreamReader getStreamReaderImpl (string scheme, string location, *hash< auto > opts)
 Returns a string stream for the file's data at the given location. More...
 
abstract string getTextFileImpl (string scheme, string location, *hash< auto > opts)
 Retrieves a text file from the given location. More...
 
abstract hash< string, hash< FileHandlerOptionInfo > > getWriteOptionsImpl ()
 Gets supported write options. More...
 
abstract writeFileImpl (string scheme, string location, data contents, *hash< auto > opts)
 Writes data to a file at the given location. More...
 

Additional Inherited Members

- Public Member Methods inherited from FileLocationHandler::AbstractFileLocationHandler
binary getBinaryFile (string scheme, string location, *hash< auto > opts)
 Retrieves a binary file from the given location. More...
 
Qore::InputStream getBinaryStream (string scheme, string location, *hash< auto > opts)
 Retrieves a binary file from the given location. More...
 
Qore::AbstractPollOperation getIoPollerForLocation (string scheme, string location, *hash< auto > opts)
 Retrieves an I/O poller to retrieve a binary file from the given location. More...
 
OutputStreamWrapper getOutputStream (string scheme, string location, *hash< auto > opts)
 Returns an output stream for writing data to the given location. More...
 
hash< string, hash< FileHandlerOptionInfo > > getReadOptions ()
 Gets supported read options. More...
 
Qore::StreamReader getStreamReader (string scheme, string location, *hash< auto > opts)
 Returns a string stream for the file's data at the given location. More...
 
string getTextFile (string scheme, string location, *hash< auto > opts)
 Retrieves a text file from the given location. More...
 
hash< string, hash< FileHandlerOptionInfo > > getWriteOptions ()
 Gets supported write options. More...
 
 writeFile (string scheme, string location, data contents, *hash< auto > opts)
 Writes data to a file at the given location. More...
 
- Static Private Member Methods inherited from FileLocationHandler::AbstractFileLocationHandler
static string forceEncoding (string str, *string encoding)
 Returns a string tagged with the given encoding, if any.
 

Detailed Description

The class for handling "rest(s)://"" locations.

Note
This class does not support writing to output streams

Member Function Documentation

◆ getBinaryFileImpl()

binary FileLocationHandler::FileLocationHandlerRest::getBinaryFileImpl ( string  scheme,
string  location,
*hash< auto >  opts 
)
privatevirtual

Retrieves a binary file from the given location.

Parameters
schemethe scheme being used
locationthe location string without the scheme
optsread options
Exceptions
REST-DATA-ERRORThe REST call returned a data type that cannot be converted to a binary
Note
This method can throw any exception related to making a REST call as well

Implements FileLocationHandler::AbstractFileLocationHandler.

◆ getBinaryStreamImpl()

Qore::InputStream FileLocationHandler::FileLocationHandlerRest::getBinaryStreamImpl ( string  scheme,
string  location,
*hash< auto >  opts 
)
privatevirtual

Retrieves a binary file from the given location.

Parameters
schemethe scheme being used
locationthe location string without the scheme
optsread options
Returns
an input stream of the file's contents, if it can be retrieved
Exceptions
REST-DATA-ERRORThe REST call returned a data type that cannot be converted to a binary
Note
This method can throw any exception related to making a REST call as well

Implements FileLocationHandler::AbstractFileLocationHandler.

◆ getIoPollerForLocationImpl()

Qore::AbstractPollOperation FileLocationHandler::FileLocationHandlerRest::getIoPollerForLocationImpl ( string  scheme,
string  location,
*hash< auto >  opts 
)
privatevirtual

Retrieves an I/O poller to retrieve a binary file from the given location.

Parameters
schemethe scheme being used
locationthe location string without the scheme
optsread options
Returns
an I/O poller to retrieve the file's data

Implements FileLocationHandler::AbstractFileLocationHandler.

◆ getOutputStreamImpl()

OutputStreamWrapper FileLocationHandler::FileLocationHandlerRest::getOutputStreamImpl ( string  scheme,
string  location,
*hash< auto >  opts 
)
privatevirtual

This method only throws a STREAM-WRITE-ERROR exception.

Parameters
schemethe scheme being used
locationthe location string without the scheme
optswrite options
Returns
always throws an exception
Exceptions
STREAM-WRITE-ERRORrest(s):// locations do not support writing to output streams

Implements FileLocationHandler::AbstractFileLocationHandler.

◆ getReadOptionsImpl()

hash< string, hash< FileHandlerOptionInfo > > FileLocationHandler::FileLocationHandlerRest::getReadOptionsImpl ( )
privatevirtual

Gets supported read options.

Returns
supported read options

Implements FileLocationHandler::AbstractFileLocationHandler.

◆ getRestClient()

object FileLocationHandler::FileLocationHandlerRest::getRestClient ( string  scheme,
string  location,
*hash< auto >  opts,
reference< string >  path,
bool  do_connect = True 
)
private

Returns a RestClient object for the given location.

Note
This method can throw any exception related to making a REST connection

◆ getStreamReaderImpl()

Qore::StreamReader FileLocationHandler::FileLocationHandlerRest::getStreamReaderImpl ( string  scheme,
string  location,
*hash< auto >  opts 
)
privatevirtual

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

Parameters
schemethe scheme being used
locationthe location string without the scheme
optsread options
Returns
a stream reader for the file's contents, if it can be retrieved
Exceptions
REST-DATA-ERRORThe REST call returned a data type that cannot be converted to a binary
Note
This method can throw any exception related to making a REST call as well

Implements FileLocationHandler::AbstractFileLocationHandler.

◆ getTextFileImpl()

string FileLocationHandler::FileLocationHandlerRest::getTextFileImpl ( string  scheme,
string  location,
*hash< auto >  opts 
)
privatevirtual

Retrieves a text file from the given location.

Parameters
schemethe scheme being used
locationthe location string without the scheme
optsread options
Returns
the string of the file's contents, if it can be retrieved
Exceptions
REST-DATA-ERRORThe REST call returned a data type that cannot be converted to a string
Note
This method can throw any exception related to making a REST call as well

Implements FileLocationHandler::AbstractFileLocationHandler.

◆ getWriteOptionsImpl()

hash< string, hash< FileHandlerOptionInfo > > FileLocationHandler::FileLocationHandlerRest::getWriteOptionsImpl ( )
privatevirtual

Gets supported write options.

Returns
supported write options

Implements FileLocationHandler::AbstractFileLocationHandler.

◆ writeFileImpl()

FileLocationHandler::FileLocationHandlerRest::writeFileImpl ( string  scheme,
string  location,
data  contents,
*hash< auto >  opts 
)
privatevirtual

Writes data to a file at the given location.

Parameters
schemethe scheme being used
locationthe location string without the scheme
contentsthe file's contents
optswrite options
Note
This method can throw any exception related to making a REST call

Implements FileLocationHandler::AbstractFileLocationHandler.

Member Data Documentation

◆ RestClientLocationOpts

const FileLocationHandler::FileLocationHandlerRest::RestClientLocationOpts

Valid REST location options.

See also
RestClient::constructor() for supported options