CMS 3D CMS Logo

Public Member Functions

HttpStorageMaker Class Reference

Inheritance diagram for HttpStorageMaker:
StorageMaker

List of all members.

Public Member Functions

virtual Storageopen (const std::string &proto, const std::string &path, int mode)

Detailed Description

Definition at line 6 of file HttpStorageMaker.cc.


Member Function Documentation

virtual Storage* HttpStorageMaker::open ( const std::string &  proto,
const std::string &  path,
int  mode 
) [inline, virtual]

Implements StorageMaker.

Definition at line 9 of file HttpStorageMaker.cc.

References f, reco::get(), RemoteFile::local(), AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, and StorageFactory::tempDir().

  {
    std::string    temp;
    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 (), 0
    };

    return RemoteFile::get (localfd, temp, (char **) curlopts, mode);
  }