98 if (!localconfservice.isAvailable())
99 throw cms::Exception(
"TrivialFileCatalog",
"edm::SiteLocalConfigService is not available");
101 m_url = (
fallback ? localconfservice->fallbackDataCatalog() : localconfservice->dataCatalog());
106 if (m_url.find(
"file:") == std::string::npos) {
108 "TrivialFileCatalog::connect: Malformed url for file catalog configuration");
111 m_url = m_url.erase(0, m_url.find(
":") + 1);
113 std::vector<std::string> tokens;
117 if (tokens.size() == 2) {
119 std::vector<std::string> optionTokens;
125 for (
size_t oi = 0, oe = optionTokens.size(); oi != oe; ++oi) {
127 std::vector<std::string> argTokens;
130 if (argTokens.size() != 2) {
132 "TrivialFileCatalog::connect: Malformed url for file catalog configuration");
135 if (argTokens[0] ==
"protocol") {
137 }
else if (argTokens[0] ==
"destination") {
145 "TrivialFileCatalog::connect: protocol was not supplied in the contact string");
148 std::ifstream configFile;
154 if (!configFile.good() || !configFile.is_open()) {
156 "TrivialFileCatalog::connect: Unable to open trivial file catalog " +
m_filename);
161 tinyxml2::XMLDocument
doc;
162 auto loadErr = doc.LoadFile(
m_filename.c_str());
163 if (loadErr != tinyxml2::XML_SUCCESS) {
165 <<
"tinyxml file load failed with error : " << doc.ErrorStr() << std::endl;
180 auto rootElement = doc.RootElement();
182 for (
auto el = rootElement->FirstChildElement(
"lfn-to-pfn"); el !=
nullptr;
183 el = el->NextSiblingElement(
"lfn-to-pfn")) {
188 for (
auto el = rootElement->FirstChildElement(
"pfn-to-lfn"); el !=
nullptr;
189 el = el->NextSiblingElement(
"pfn-to-lfn")) {
std::vector< std::string_view > split(std::string_view, const char *)
std::string m_destination
ProtocolRules m_inverseRules
ProtocolRules m_directRules
std::vector< std::string > m_protocols
void parseRule(tinyxml2::XMLElement *ruleNode, ProtocolRules &rules)