27#ifndef _bes_http_REMOTE_HTTP_RESOURCE_H_
28#define _bes_http_REMOTE_HTTP_RESOURCE_H_ 1
49 friend class RemoteResourceTest;
51 static std::string d_temp_file_dir;
54 static void set_temp_file_dir();
56 static std::mutex d_temp_file_dir_mutex;
59 std::shared_ptr<http::url> d_url;
65 bool d_initialized =
false;
74 std::string d_filename;
78 std::string d_basename;
81 bool d_delete_file =
true;
84 std::vector<std::string> d_response_headers;
90 static std::mutex d_mkstemp_mutex;
92 void set_filename_for_file_url();
94 void set_delete_temp_file();
101 explicit RemoteResource(std::shared_ptr<http::url> target_url, std::string uid =
"");
std::string get_filename() const
Returns the file name in which the content of the URL has been stored.
int get_fd() const
Return the file descriptor to the open temp file.
RemoteResource()=default
The default constructor is here to ease testing. Remove if not needed. jhrg 3/8/23.
virtual ~RemoteResource()
std::string get_type() const
Parse a URL into the protocol, host, path and query parts.
utility class for the HTTP catalog module