97 if (!localconfservice.isAvailable())
98 throw cms::Exception(
"TrivialFileCatalog",
"edm::SiteLocalConfigService is not available");
99 if (iCatalog >= localconfservice->dataCatalogs().size())
100 throw cms::Exception(
"TrivialFileCatalog",
"edm::FileLocator: Request nonexistence data catalog");
101 m_url = localconfservice->dataCatalogs()[iCatalog];
104 if (m_url.find(
"file:") == std::string::npos) {
106 "TrivialFileCatalog::connect: Malformed url for file catalog configuration");
109 m_url = m_url.erase(0, m_url.find(
':') + 1);
111 std::vector<std::string> tokens;
115 if (tokens.size() == 2) {
117 std::vector<std::string> optionTokens;
123 for (
size_t oi = 0, oe = optionTokens.size(); oi != oe; ++oi) {
125 std::vector<std::string> argTokens;
128 if (argTokens.size() != 2) {
130 "TrivialFileCatalog::connect: Malformed url for file catalog configuration");
133 if (argTokens[0] ==
"protocol") {
135 }
else if (argTokens[0] ==
"destination") {
143 "TrivialFileCatalog::connect: protocol was not supplied in the contact string");
152 if (!configFile.good() || !configFile.is_open()) {
154 "TrivialFileCatalog::connect: Unable to open trivial file catalog " +
m_filename);
159 tinyxml2::XMLDocument doc;
160 auto loadErr = doc.LoadFile(
m_filename.c_str());
161 if (loadErr != tinyxml2::XML_SUCCESS) {
163 <<
"tinyxml file load failed with error : " << doc.ErrorStr() << std::endl;
176 auto rootElement = doc.RootElement();
178 for (
auto el = rootElement->FirstChildElement(
"lfn-to-pfn"); el !=
nullptr;
179 el = el->NextSiblingElement(
"lfn-to-pfn")) {
184 for (
auto el = rootElement->FirstChildElement(
"pfn-to-lfn"); el !=
nullptr;
185 el = el->NextSiblingElement(
"pfn-to-lfn")) {
std::string m_destination
ProtocolRules m_inverseRules
ProtocolRules m_directRules
std::vector< std::string > m_protocols
void parseRule(tinyxml2::XMLElement *ruleNode, ProtocolRules &rules)