MCPcopy Create free account
hub / github.com/apple/foundationdb / listURLs

Method listURLs

fdbclient/BackupContainerLocalDirectory.actor.cpp:168–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168Future<std::vector<std::string>> BackupContainerLocalDirectory::listURLs(const std::string& url) {
169 std::string path;
170 if (url.find("file://") != 0) {
171 TraceEvent(SevWarn, "BackupContainerLocalDirectory")
172 .detail("Description", "Invalid URL for BackupContainerLocalDirectory")
173 .detail("URL", url);
174 }
175
176 path = url.substr(7);
177 // Remove trailing slashes on path
178 path.erase(path.find_last_not_of("\\/") + 1);
179
180 if (!g_network->isSimulated() && path != abspath(path)) {
181 TraceEvent(SevWarn, "BackupContainerLocalDirectory")
182 .detail("Description", "Backup path must be absolute (e.g. file:///some/path)")
183 .detail("URL", url)
184 .detail("Path", path);
185 throw io_error();
186 }
187 std::vector<std::string> dirs = platform::listDirectories(path);
188 std::vector<std::string> results;
189
190 for (const auto& r : dirs) {
191 if (r == "." || r == "..")
192 continue;
193 results.push_back(std::string("file://") + joinPath(path, r));
194 }
195
196 return results;
197}
198
199Future<Void> BackupContainerLocalDirectory::create() {
200 if (usesEncryption()) {

Callers

nothing calls this directly

Calls 10

TraceEventClass · 0.85
listDirectoriesFunction · 0.85
detailMethod · 0.80
substrMethod · 0.80
abspathFunction · 0.50
joinPathFunction · 0.50
findMethod · 0.45
eraseMethod · 0.45
isSimulatedMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected