Qore FileLocationHandler Module Reference  2.0
FileLocationHandlerSftp.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* FileLocationHandlerSftp Copyright 2021 - 2022 Qore Technologies, s.r.o.
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
26 namespace FileLocationHandler {
29 
30 public:
32 
38  "encoding": <FileHandlerOptionInfo>{
39  "type": "string",
40  "desc": "file encoding (read / write)",
41  },
42  "ssh2_private_key": <FileHandlerOptionInfo>{
43  "type": "string",
44  "desc": "the private key file",
45  },
46  "ssh2_public_key": <FileHandlerOptionInfo>{
47  "type": "string",
48  "desc": "the public key file",
49  },
50  };
51 
53 
61 protected:
62  string getTextFileImpl(string scheme, string location, *hash<auto> opts);
63 public:
64 
65 
67 
75 protected:
76  binary getBinaryFileImpl(string scheme, string location, *hash<auto> opts);
77 public:
78 
79 
81 
87 protected:
88  Qore::StreamReader getStreamReaderImpl(string scheme, string location, *hash<auto> opts);
89 public:
90 
91 
93 
99 protected:
100  Qore::InputStream getBinaryStreamImpl(string scheme, string location, *hash<auto> opts);
101 public:
102 
103 
105 
110 protected:
111  writeFileImpl(string scheme, string location, data contents, *hash<auto> opts);
112 public:
113 
114 
116 
128 protected:
129  OutputStreamWrapper getOutputStreamImpl(string scheme, string location, *hash<auto> opts);
130 public:
131 
132 
134 
136 protected:
137  hash<string, hash<FileHandlerOptionInfo>> getReadOptionsImpl();
138 public:
139 
140 
142 
144 protected:
145  hash<string, hash<FileHandlerOptionInfo>> getWriteOptionsImpl();
146 public:
147 
148 
150 protected:
151  object getSftpClient(string scheme, string location, *hash<auto> opts, reference<string> file);
152 public:
153 
154 };
155 };
The abstract file location handler class.
Definition: FileLocationHandler.qc.dox.h:43
The class for handling file locations.
Definition: FileLocationHandlerSftp.qc.dox.h:28
Qore::InputStream getBinaryStreamImpl(string scheme, string location, *hash< auto > opts)
Retrieves a binary file from the given location.
string getTextFileImpl(string scheme, string location, *hash< auto > opts)
Retrieves a text 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.
Qore::StreamReader getStreamReaderImpl(string scheme, string location, *hash< auto > opts)
Returns a stream reader for the file's data at the given location.
object getSftpClient(string scheme, string location, *hash< auto > opts, reference< string > file)
Returns an SFTP client for the given location.
writeFileImpl(string scheme, string location, data contents, *hash< auto > opts)
Writes data to a file at the given location.
const SftpClientLocationOpts
Valid SFTP location options.
Definition: FileLocationHandlerSftp.qc.dox.h:37
hash< string, hash< FileHandlerOptionInfo > > getWriteOptionsImpl()
Gets supported write options.
hash< string, hash< FileHandlerOptionInfo > > getReadOptionsImpl()
Gets supported read options.
binary getBinaryFileImpl(string scheme, string location, *hash< auto > opts)
Retrieves a binary file from the given location.
The abstract file location handler class.
Definition: OutputStramWrapper.qc.dox.h:28
binary binary()
Contains all public definitions in the FileLocationHandler module.
Definition: FileLocationHandler.qc.dox.h:26
File handler option info.
Definition: FileLocationHandler.qc.dox.h:28