Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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
{
8
public
:
9
virtual
Storage
*
open
(
const
std::string
&proto,
10
const
std::string
&
path
,
11
int
mode
)
override
12
{
13
std::string
temp
;
14
StorageFactory
*
f
=
StorageFactory::get
();
15
int
localfd =
RemoteFile::local
(f->
tempDir
(),
temp
);
16
std::string
newurl ((proto ==
"web"
?
"http"
: proto) +
":"
+ path);
17
const
char
*curlopts [] = {
18
"curl"
,
"-L"
,
"-f"
,
"-o"
, temp.c_str(),
"-q"
,
"-s"
,
"--url"
,
19
newurl.c_str (), 0
20
};
21
22
return
RemoteFile::get
(localfd, temp, (
char
**) curlopts, mode);
23
}
24
};
25
26
DEFINE_EDM_PLUGIN
(
StorageMakerFactory
,
HttpStorageMaker
,
"http"
);
27
DEFINE_EDM_PLUGIN
(
StorageMakerFactory
,
HttpStorageMaker
,
"ftp"
);
28
DEFINE_EDM_PLUGIN
(
StorageMakerFactory
,
HttpStorageMaker
,
"web"
);
HttpStorageMaker::open
virtual Storage * open(const std::string &proto, const std::string &path, int mode) override
Definition:
HttpStorageMaker.cc:9
StorageFactory
Definition:
StorageFactory.h:12
StorageMakerFactory.h
groupFilesInBlocks.temp
temp
Definition:
groupFilesInBlocks.py:140
getHLTPrescaleColumns.path
list path
Definition:
getHLTPrescaleColumns.py:16
Storage
Definition:
Storage.h:20
StorageMaker
Definition:
StorageMaker.h:8
alignBH_cfg.mode
list mode
Definition:
alignBH_cfg.py:7
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
StorageFactory::get
static StorageFactory * get(void)
Definition:
StorageFactory.cc:33
RemoteFile::local
static int local(const std::string &tmpdir, std::string &temp)
Definition:
RemoteFile.cc:55
RemoteFile.h
edmplugin::PluginFactory
Definition:
PluginFactory.h:31
StorageFactory::tempDir
std::string tempDir(void) const
Definition:
StorageFactory.cc:121
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
HttpStorageMaker
Definition:
HttpStorageMaker.cc:6
RemoteFile::get
static Storage * get(int localfd, const std::string &name, char **cmd, int mode)
Definition:
RemoteFile.cc:90
StorageFactory.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:101
StorageMaker.h
Generated for CMSSW Reference Manual by
1.8.5