/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWStorage/StorageFactory/plugins/HttpStorageMaker.cc
27 строк
1 KB
Chris Jones
Move Utilities/StorageFactory to FWStorage/StorageFactory
10 дек 2025, 18:12
10 дек 2025, 18:12
852ff34
Код
Авторство
О чём код?
#include "FWStorage/StorageFactory/interface/StorageMaker.h" #include "FWStorage/StorageFactory/interface/StorageMakerFactory.h" #include "FWStorage/StorageFactory/interface/StorageFactory.h" #include "FWStorage/StorageFactory/interface/RemoteFile.h" namespace edm::storage { class HttpStorageMaker : public StorageMaker { public: std::unique_ptr<Storage> open(const std::string &proto, const std::string &path, int mode, const AuxSettings &) const override { std::string temp; const StorageFactory *f = StorageFactory::get(); int localfd = RemoteFile::local(f->tempDir(), temp); std::string newurl((proto == "web" ? "http" : proto) + ":" + path); const char *curlopts[] = {"curl", "-L", "-f", "-o", temp.c_str(), "-q", "-s", "--url", newurl.c_str(), nullptr}; return RemoteFile::get(localfd, temp, (char **)curlopts, mode); } UseLocalFile usesLocalFile() const override { return UseLocalFile::kYes; } }; } // namespace edm::storage using namespace edm::storage; DEFINE_EDM_PLUGIN(StorageMakerFactory, HttpStorageMaker, "ftp");