Main Page
Namespaces
Classes
Package Documentation
Utilities
StorageFactory
plugins
HttpStorageMaker.cc
Go to the documentation of this file.
1
#include "
Utilities/StorageFactory/interface/StorageMaker.h
"
2
#include "
Utilities/StorageFactory/interface/StorageMakerFactory.h
"
3
#include "
Utilities/StorageFactory/interface/StorageFactory.h
"
4
#include "
Utilities/StorageFactory/interface/RemoteFile.h
"
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
{
12
std::string
temp
;
13
const
StorageFactory
*
f
=
StorageFactory::get
();
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
22
DEFINE_EDM_PLUGIN
(
StorageMakerFactory
,
HttpStorageMaker
,
"ftp"
);
StorageFactory
Definition:
StorageFactory.h:13
castor_dqm_sourceclient_file_cfg.path
path
Definition:
castor_dqm_sourceclient_file_cfg.py:37
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
StorageMakerFactory.h
groupFilesInBlocks.temp
temp
Definition:
groupFilesInBlocks.py:142
StorageMaker::AuxSettings
Definition:
StorageMaker.h:11
StorageMaker
Definition:
StorageMaker.h:9
RemoteFile::get
static std::unique_ptr< Storage > get(int localfd, const std::string &name, char **cmd, int mode)
Definition:
RemoteFile.cc:78
RemoteFile::local
static int local(const std::string &tmpdir, std::string &temp)
Definition:
RemoteFile.cc:48
RemoteFile.h
StorageFactory::get
static const StorageFactory * get(void)
Definition:
StorageFactory.cc:26
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition:
ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
StorageFactory::tempDir
std::string tempDir(void) const
Definition:
StorageFactory.cc:88
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
HttpStorageMaker
Definition:
HttpStorageMaker.cc:6
StorageFactory.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:124
HttpStorageMaker::open
std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &) const override
Definition:
HttpStorageMaker.cc:8
StorageMaker.h
Generated for CMSSW Reference Manual by
1.8.11