Lists all file, potentially recursively, in a bucket include_implicit_dirs controls whether or not implicit directories should be included. These are directories that are not actually file objects but instead are inferred from other objects. For example, if a file exists with path A/B/C then implicit directories A/ and A/B/ will exist even if there are no file objects with these paths.
| 2689 | // For example, if a file exists with path A/B/C then implicit directories A/ and A/B/ |
| 2690 | // will exist even if there are no file objects with these paths. |
| 2691 | void ListAsync(const FileSelector& select, const std::string& bucket, |
| 2692 | const std::string& key, bool include_implicit_dirs, |
| 2693 | util::AsyncTaskScheduler* scheduler, FileInfoSink sink) { |
| 2694 | // We can only fetch kListObjectsMaxKeys files at a time and so we create a |
| 2695 | // scheduler and schedule a task to grab the first batch. Once that's done we |
| 2696 | // schedule a new task for the next batch. All of these tasks share the same |
| 2697 | // FileListerState object but none of these tasks run in parallel so there is |
| 2698 | // no need to worry about mutexes |
| 2699 | auto state = std::make_shared<FileListerState>(sink, select, bucket, key, |
| 2700 | include_implicit_dirs, io_context_, |
| 2701 | this->holder_.get()); |
| 2702 | |
| 2703 | // Create the first file lister task (it may spawn more) |
| 2704 | auto file_lister_task = std::make_unique<FileListerTask>(state, scheduler); |
| 2705 | scheduler->AddTask(std::move(file_lister_task)); |
| 2706 | } |
| 2707 | |
| 2708 | // Fully list all files from all buckets |
| 2709 | void FullListAsync(bool include_implicit_dirs, util::AsyncTaskScheduler* scheduler, |
no test coverage detected