bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
|
#include <RemoteResource.h>
Public Member Functions | |
int | get_fd () const |
Return the file descriptor to the open temp file. | |
std::string | get_filename () const |
Returns the file name in which the content of the URL has been stored. | |
std::string | get_type () const |
RemoteResource & | operator= (const RemoteResource &rhs)=delete |
RemoteResource ()=default | |
The default constructor is here to ease testing. Remove if not needed. jhrg 3/8/23. | |
RemoteResource (const RemoteResource &rhs)=delete | |
RemoteResource (std::shared_ptr< http::url > target_url, std::string uid="") | |
Construct a new RemoteResource object. | |
void | retrieve_resource () |
virtual | ~RemoteResource () |
Friends | |
class | RemoteResourceTest |
This class encapsulates a remote resource available via HTTP GET. It will retrieve the content of the resource and place it in a local temporary file. It can be configured to use a proxy server for the outgoing requests using features of the CurlUtils functions.
Definition at line 47 of file RemoteResource.h.
|
default |
The default constructor is here to ease testing. Remove if not needed. jhrg 3/8/23.
|
explicit |
Construct a new RemoteResource object.
If the target_url is a file:// url then this will check make sure that file is within the BES 'catalog' root directory. If it is a remote resource then this will make sure the directory set by the Http.RemoteResource.TmpDir key exists and is writable.
To get a remote resource, use the retrieve_resource() method.
target_url | An instance of http::url that points to the resource to be retrieved. |
uid | The user ID to use when retrieving the resource. |
Definition at line 80 of file RemoteResource.cc.
|
virtual |
Unlink the temporary file and close its open file descriptor. This will remove the temporary file from the file system.
Definition at line 117 of file RemoteResource.cc.
|
inline |
Return the file descriptor to the open temp file.
Definition at line 117 of file RemoteResource.h.
|
inline |
Returns the file name in which the content of the URL has been stored.
Definition at line 114 of file RemoteResource.h.
|
inline |
Returns the DAP type std::string of the RemoteHttpResource
Definition at line 111 of file RemoteResource.h.
void http::RemoteResource::retrieve_resource | ( | ) |
This method will retrieve the remote resource content using HTTP GET.
When this method returns the RemoteResource object is fully initialized URL contents are available in the temporary file. For file:// URLs this method is a no-op.
Definition at line 198 of file RemoteResource.cc.
|
friend |
Definition at line 49 of file RemoteResource.h.