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

The class for handling "sftp://"" locations. More...

#include <FileLocationHandlerSftp.qc.dox.h>

Inheritance diagram for FileLocationHandler::FileLocationHandlerSftp:
[legend]

Public Attributes

const SftpClientLocationOpts = ...
 Valid SFTP location options.
 

Private Member Methods

binary getBinaryFileImpl (string scheme, string location, *hash< auto > opts)
 Retrieves a binary file from the given location.
 
Qore::InputStream getBinaryStreamImpl (string scheme, string location, *hash< auto > opts)
 Retrieves a binary file from the given location.
 
Qore::AbstractPollOperation getIoPollerForLocationImpl (string scheme, string location, *hash< auto > opts)
 Retrieves an I/O poller to retrieve a binary file from the given location.
 
OutputStreamWrapper getOutputStreamImpl (string scheme, string location, *hash< auto > opts)
 Returns an output stream for writing data to the given location.
 
hash< string, hash< FileHandlerOptionInfo > > getReadOptionsImpl ()
 Gets supported read options.
 
object getSftpClient (string scheme, string location, *hash< auto > opts, reference< string > file)
 Returns an SFTP client for the given location.
 
Qore::StreamReader getStreamReaderImpl (string scheme, string location, *hash< auto > opts)
 Returns a stream reader for the file's data at the given location.
 
string getTextFileImpl (string scheme, string location, *hash< auto > opts)
 Retrieves a text file from the given location.
 
hash< string, hash< FileHandlerOptionInfo > > getWriteOptionsImpl ()
 Gets supported write options.
 
 writeFileImpl (string scheme, string location, data contents, *hash< auto > opts)
 Writes data to a file at the given location.
 
- Private Member Methods inherited from FileLocationHandler::AbstractFileLocationHandler
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 Qore::AbstractPollOperation getIoPollerForLocationImpl (string scheme, string location, *hash< auto > opts)
 Retrieves an I/O poller to retrieve 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.
 

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.
 
Qore::InputStream getBinaryStream (string scheme, string location, *hash< auto > opts)
 Retrieves a binary file from the given location.
 
Qore::AbstractPollOperation getIoPollerForLocation (string scheme, string location, *hash< auto > opts)
 Retrieves an I/O poller to retrieve 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.
 
- 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 "sftp://"" locations.

Does not currently support non-blocking I/O operations

Member Function Documentation

◆ getBinaryFileImpl()

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

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
Note
This method can throw any exception related to making an SFTP transfer

◆ getBinaryStreamImpl()

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

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
This method can throw any exception related to making an SFTP transfer

◆ getIoPollerForLocationImpl()

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

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

◆ getOutputStreamImpl()

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

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
  • OutputStream::close() must be called to close the stream after writing terminates in order to avoid a deadlock
  • The data written to the OutputStreamWrapper object is written in the background; to ensure that the data has been written to the target, call OutputStreamWrapper::waitForIo()
  • This method can throw any exception related to making an SFTP transfer

◆ getReadOptionsImpl()

hash< string, hash< FileHandlerOptionInfo > > FileLocationHandler::FileLocationHandlerSftp::getReadOptionsImpl ( )
private

Gets supported read options.

Returns
supported read options

◆ getStreamReaderImpl()

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

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
Note
This method can throw any exception related to making an SFTP transfer

◆ getTextFileImpl()

string FileLocationHandler::FileLocationHandlerSftp::getTextFileImpl ( string  scheme,
string  location,
*hash< auto >  opts 
)
private

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
Note
This method can throw any exception related to making an SFTP transfer

◆ getWriteOptionsImpl()

hash< string, hash< FileHandlerOptionInfo > > FileLocationHandler::FileLocationHandlerSftp::getWriteOptionsImpl ( )
private

Gets supported write options.

Returns
supported write options

◆ writeFileImpl()

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

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 an SFTP transfer

Member Data Documentation

◆ SftpClientLocationOpts

const FileLocationHandler::FileLocationHandlerSftp::SftpClientLocationOpts = ...

Valid SFTP location options.

supported options:

  • encoding: the output string encoding for text files
  • ssh2_private_key: the path to the private key file
  • ssh2_public_key: the path to the public key file