Qore FileLocationHandler Module Reference  2.0
FileLocationHandler::AbstractFileLocationHandler Class Referenceabstract

The abstract file location handler class. More...

Inheritance diagram for FileLocationHandler::AbstractFileLocationHandler:

Public Member Methods

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...
 
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...
 

Private Member Methods

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 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...
 

Static Private Member Methods

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
schemethe scheme being used
locationthe location string without the scheme
optsread 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 
)
privatepure virtual

Retrieves a binary file from the given location.

Parameters
schemethe scheme being used
locationthe location string without the scheme
optsread options
Returns
the binary data of the file's contents, if it can be retrieved

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

◆ getBinaryStream()

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

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
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 
)
privatepure virtual

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

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

◆ getOutputStream()

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

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

Parameters
schemethe scheme being used
locationthe location string without the scheme
optswrite options
Returns
an output stream for writing to the file
Note

◆ getOutputStreamImpl()

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

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

Parameters
schemethe scheme being used
locationthe location string without the scheme
optswrite options
Returns
an output stream for writing to the file
Note

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

◆ 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 ( )
privatepure virtual

◆ 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
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
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 
)
privatepure virtual

Returns a string stream 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

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

◆ getTextFile()

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

Retrieves a text file from the given location.

Parameters
schemethe scheme being used
locationthe location string without the scheme or options
optsread 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 
)
privatepure virtual

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

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

◆ 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 ( )
privatepure virtual

◆ writeFile()

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

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

◆ writeFileImpl()

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

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

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