CMS 3D CMS Logo

HttpStorageMaker.cc
Go to the documentation of this file.
5 
6 namespace edm::storage {
7  class HttpStorageMaker : public StorageMaker {
8  public:
9  std::unique_ptr<Storage> open(const std::string &proto,
10  const std::string &path,
11  int mode,
12  const AuxSettings &) const override {
15  int localfd = RemoteFile::local(f->tempDir(), temp);
16  std::string newurl((proto == "web" ? "http" : proto) + ":" + path);
17  const char *curlopts[] = {"curl", "-L", "-f", "-o", temp.c_str(), "-q", "-s", "--url", newurl.c_str(), nullptr};
18 
19  return RemoteFile::get(localfd, temp, (char **)curlopts, mode);
20  }
21  };
22 } // namespace edm::storage
23 
24 using namespace edm::storage;
std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &) const override
static std::unique_ptr< Storage > get(int localfd, const std::string &name, char **cmd, int mode)
Definition: RemoteFile.cc:80
double f[11][100]
static int local(const std::string &tmpdir, std::string &temp)
Definition: RemoteFile.cc:50
#define DEFINE_EDM_PLUGIN(factory, type, name)
static const StorageFactory * get(void)