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.
| 2748 | // For example, if a file exists with path A/B/C then implicit directories A/ and A/B/ |
| 2749 | // will exist even if there are no file objects with these paths. |
| 2750 | void ListAsync(const FileSelector& select, const std::string& bucket, |
| 2751 | const std::string& key, bool include_implicit_dirs, |
| 2752 | util::AsyncTaskScheduler* scheduler, FileInfoSink sink) { |
| 2753 | // We can only fetch kListObjectsMaxKeys files at a time and so we create a |
| 2754 | // scheduler and schedule a task to grab the first batch. Once that's done we |
| 2755 | // schedule a new task for the next batch. All of these tasks share the same |
| 2756 | // FileListerState object but none of these tasks run in parallel so there is |
| 2757 | // no need to worry about mutexes |
| 2758 | auto state = std::make_shared<FileListerState>(sink, select, bucket, key, |
| 2759 | include_implicit_dirs, io_context_, |
| 2760 | this->holder_.get()); |
| 2761 | |
| 2762 | // Create the first file lister task (it may spawn more) |
| 2763 | auto file_lister_task = std::make_unique<FileListerTask>(state, scheduler); |
| 2764 | scheduler->AddTask(std::move(file_lister_task)); |
| 2765 | } |
| 2766 | |
| 2767 | // Fully list all files from all buckets |
| 2768 | void FullListAsync(bool include_implicit_dirs, util::AsyncTaskScheduler* scheduler, |
no test coverage detected