CMS 3D CMS Logo

GsiFTPStorageMaker.cc

Go to the documentation of this file.
00001 #include "Utilities/StorageFactory/interface/StorageMaker.h"
00002 #include "Utilities/StorageFactory/interface/StorageMakerFactory.h"
00003 #include "Utilities/StorageFactory/interface/RemoteFile.h"
00004 
00005 class GsiFTPStorageMaker : public StorageMaker
00006 {
00007 public:
00008   virtual Storage *open (const std::string &proto,
00009                          const std::string &path,
00010                          int mode,
00011                          const std::string &tmpdir)
00012   {
00013     std::string temp;
00014     int         localfd = RemoteFile::local (tmpdir, temp);
00015     std::string lurl = "file://" + temp;
00016     std::string newurl ((proto == "sfn" ? "gsiftp" : proto) + ":" + path);
00017     const char  *ftpopts [] = { "globus-url-copy", newurl.c_str (), lurl.c_str (), 0 };
00018     return RemoteFile::get (localfd, temp, (char **) ftpopts, mode);
00019   }
00020 };
00021 
00022 DEFINE_EDM_PLUGIN (StorageMakerFactory, GsiFTPStorageMaker, "gsiftp");
00023 DEFINE_EDM_PLUGIN (StorageMakerFactory, GsiFTPStorageMaker, "sfn");

Generated on Tue Jun 9 17:48:53 2009 for CMSSW by  doxygen 1.5.4