Qore FileLocationHandler Module Reference 2.3
Loading...
Searching...
No Matches
FileLocationHandlerRest.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* FileLocationHandlerRest Copyright 2021 - 2024 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
26namespace FileLocationHandler {
28
31
32public:
34
37
38
40
50protected:
51 string getTextFileImpl(string scheme, string location, *hash<auto> opts);
52public:
53
54
56
64protected:
65 binary getBinaryFileImpl(string scheme, string location, *hash<auto> opts);
66public:
67
68
70
76protected:
77 Qore::AbstractPollOperation getIoPollerForLocationImpl(string scheme, string location, *hash<auto> opts);
78public:
79
80
82
92protected:
93 Qore::StreamReader getStreamReaderImpl(string scheme, string location, *hash<auto> opts);
94public:
95
96
98
108protected:
109 Qore::InputStream getBinaryStreamImpl(string scheme, string location, *hash<auto> opts);
110public:
111
112
114
121protected:
122 writeFileImpl(string scheme, string location, data contents, *hash<auto> opts);
123public:
124
125
127
135protected:
136 OutputStreamWrapper getOutputStreamImpl(string scheme, string location, *hash<auto> opts);
137public:
138
139
141
143protected:
144 hash<string, hash<FileHandlerOptionInfo>> getReadOptionsImpl();
145public:
146
147
149
151protected:
152 hash<string, hash<FileHandlerOptionInfo>> getWriteOptionsImpl();
153public:
154
155
157
160protected:
161 object getRestClient(string scheme, string location, *hash<auto> opts, reference<string> path, bool do_connect = True);
162public:
163
164};
165
167class HttpPollWrapper : public AbstractPollOperation {
168
169public:
170protected:
172 AbstractPollOperation op;
173
174public:
175
177 constructor(AbstractPollOperation op);
178
179
181 string getGoal();
182
183
185 string getState();
186
187
190
191
193 *hash<SocketPollInfo> continuePoll();
194
195
197 auto getOutput();
198
199
202
203};
204};
The abstract file location handler class.
Definition FileLocationHandler.qc.dox.h:53
The class for handling "rest(s)://"" locations.
Definition FileLocationHandlerRest.qc.dox.h:30
binary getBinaryFileImpl(string scheme, string location, *hash< auto > opts)
Retrieves a binary file from the given location.
hash< string, hash< FileHandlerOptionInfo > > getReadOptionsImpl()
Gets supported read options.
object getRestClient(string scheme, string location, *hash< auto > opts, reference< string > path, bool do_connect=True)
Returns a RestClient object for the given location.
OutputStreamWrapper getOutputStreamImpl(string scheme, string location, *hash< auto > opts)
This method only throws a STREAM-WRITE-ERROR exception.
writeFileImpl(string scheme, string location, data contents, *hash< auto > opts)
Writes data to a file at the given location.
const RestClientLocationOpts
Valid REST location options.
Definition FileLocationHandlerRest.qc.dox.h:36
Qore::StreamReader getStreamReaderImpl(string scheme, string location, *hash< auto > opts)
Returns a stream reader for the file's data at 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.
string getTextFileImpl(string scheme, string location, *hash< auto > opts)
Retrieves a text file from the given location.
Qore::InputStream getBinaryStreamImpl(string scheme, string location, *hash< auto > opts)
Retrieves a binary file from the given location.
hash< string, hash< FileHandlerOptionInfo > > getWriteOptionsImpl()
Gets supported write options.
Wraps an HTTP poller so that the response body is always returned as the output.
Definition FileLocationHandlerRest.qc.dox.h:167
bool goalReached()
Calls the corresponding method in the wrapped poller and returns the return value.
abort()
Aborts the current operation.
string getState()
Calls the corresponding method in the wrapped poller and returns the return value.
AbstractPollOperation op
The HTTP poller to execute.
Definition FileLocationHandlerRest.qc.dox.h:172
auto getOutput()
Returns the value of the "response-body" key in the wrapped HTTP poller's output data.
constructor(AbstractPollOperation op)
Creates the object wrapping the HTTP poller passed as an argument.
string getGoal()
Calls the corresponding method in the wrapped poller and returns the return value.
*hash< SocketPollInfo > continuePoll()
Calls the corresponding method in the wrapped poller and returns the return value.
The abstract file location handler class.
Definition OutputStramWrapper.qc.dox.h:28
Contains all public definitions in the FileLocationHandler module.
Definition FileLocationHandler.qc.dox.h:26