bes
Updated for version 3.20.6
|
#include <RemoteHttpResource.h>
Public Member Functions | |
std::string | get_http_response_header (const std::string header_name) |
std::string | getCacheFileName () |
std::vector< std::string > * | getResponseHeaders () |
std::string | getType () |
RemoteHttpResource (const std::string &url) | |
void | retrieveResource () |
virtual | ~RemoteHttpResource () |
This class encapsulates a remote resource available via HTTP GET. It will retrieve the content of the resource and place it in a local disk cache for rapid (subsequent) access. It can be configure to use a proxy server for the outgoing requests.
Definition at line 49 of file cmr_module/RemoteHttpResource.h.
RemoteHttpResource::RemoteHttpResource | ( | const std::string & | url | ) |
Builds a RemoteHttpResource object associated with the passed url
parameter.
url | Is a URL string that identifies the remote resource. |
Definition at line 57 of file cmr_module/RemoteHttpResource.cc.
|
virtual |
Releases any memory resources and also any existing cache file locks for the cached resource. ( Closes the file descriptor opened when retrieveResource() was called.)
Definition at line 92 of file cmr_module/RemoteHttpResource.cc.
std::string RemoteHttpResource::get_http_response_header | ( | const std::string | header_name | ) |
Returns the value of the requested HTTP response header. Evaluation is case-insensitive. If the requested header_name is not found the empty string is returned.
Definition at line 384 of file cmr_module/RemoteHttpResource.cc.
|
inline |
Returns the (read-locked) cache file name on the local system in which the content of the remote resource is stored. Deleting of the instance of this class will release the read-lock.
Definition at line 121 of file cmr_module/RemoteHttpResource.h.
|
inline |
Returns a std::vector of HTTP headers received along with the response from the request for the remote resource..
Definition at line 135 of file cmr_module/RemoteHttpResource.h.
|
inline |
Returns the DAP type std::string of the RemoteHttpResource
Definition at line 112 of file cmr_module/RemoteHttpResource.h.
void RemoteHttpResource::retrieveResource | ( | ) |
This method will check the cache for the resource. If it's not there then it will lock the cache and retrieve the remote resource content using HTTP GET.
When this method returns the RemoteHttpResource object is fully initialized and the cache file name for the resource is available along with an open file descriptor for the (now read-locked) cache file.
Definition at line 130 of file cmr_module/RemoteHttpResource.cc.