CMS 3D CMS Logo

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