LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::TrivialFileTransfer Class Reference
Inheritance diagram for art::TrivialFileTransfer:
art::FileTransfer

Classes

struct  Config
 

Public Types

using Parameters = ServiceTable< Config >
 

Public Member Functions

 ~TrivialFileTransfer ()
 
 TrivialFileTransfer (Parameters const &pset)
 
 TrivialFileTransfer (TrivialFileTransfer const &)
 
 TrivialFileTransfer (TrivialFileTransfer &&)
 
TrivialFileTransferoperator= (TrivialFileTransfer const &)
 
TrivialFileTransferoperator= (TrivialFileTransfer &&)
 
int translateToLocalFilename (std::string const &uri, std::string &fileFQname)
 

Private Member Functions

int doTranslateToLocalFilename (std::string const &uri, std::string &fileFQname) override
 

Detailed Description

Definition at line 23 of file TrivialFileTransfer_service.cc.

Member Typedef Documentation

Constructor & Destructor Documentation

art::TrivialFileTransfer::~TrivialFileTransfer ( )
default
art::TrivialFileTransfer::TrivialFileTransfer ( TrivialFileTransfer::Parameters const &  pset)

Definition at line 44 of file TrivialFileTransfer_service.cc.

46  {}
art::TrivialFileTransfer::TrivialFileTransfer ( TrivialFileTransfer const &  )
default
art::TrivialFileTransfer::TrivialFileTransfer ( TrivialFileTransfer &&  )
default

Member Function Documentation

int art::TrivialFileTransfer::doTranslateToLocalFilename ( std::string const &  uri,
std::string &  fileFQname 
)
overrideprivatevirtual

Implements art::FileTransfer.

Definition at line 60 of file TrivialFileTransfer_service.cc.

References art::detail::FDS::BAD_REQUEST, DECLARE_ART_SERVICE_INTERFACE_IMPL, DEFINE_ART_SERVICE_INTERFACE_IMPL, art::detail::FDS::NOT_FOUND, art::detail::FDS::PENDING, art::SHARED, and SUCCESS.

62  {
63  if (uri.substr(0, 7) != fileURI) {
64  // Unexpected protocol: pass through.
65  fileFQname = uri;
67  }
69  fileFQname = "";
70  if (uri.substr(0, 7) != fileURI) {
72  return stat;
73  }
74  string inFileName{uri.substr(7)};
75  ifstream infile{inFileName};
76  if (!infile) {
78  return stat;
79  }
80  fileFQname = inFileName;
82  return stat;
83  // Implementation plan details -- alternatives not chosen:
84  // x We could merely return the file name (the URI with file:// stripped
85  // off).
86  // Since the SAM developers may look at this file as a template for their
87  // real GeneralFileTransfer service, it is perhaps better to do the work
88  // of making a copy into a designated area.
89  // x We merely strip the file:// from the URI; this adhoc class is not
90  // beefed
91  // up to deal with genuine web access.
92  // x An alternative would be to embed the last part of the file FQname into
93  // the
94  // scratch file name, to try to maintain traceability in case things
95  // break.
96  }
TrivialFileTransfer & art::TrivialFileTransfer::operator= ( TrivialFileTransfer const &  )
default
TrivialFileTransfer & art::TrivialFileTransfer::operator= ( TrivialFileTransfer &&  )
default
int art::FileTransfer::translateToLocalFilename ( std::string const &  uri,
std::string &  fileFQname 
)
inlineinherited

Definition at line 32 of file FileTransfer.h.

References DECLARE_ART_SERVICE_INTERFACE, art::FileTransfer::doTranslateToLocalFilename(), and art::SHARED.

34  {
35  return doTranslateToLocalFilename(uri, fileFQname);
36  }
virtual int doTranslateToLocalFilename(std::string const &uri, std::string &fileFQname)=0

The documentation for this class was generated from the following file: