The normalize_directories parameter is needed because how a directory is listed. If a specific path is asked for with a trailing slash it is expected to have a trailing slash [1] but for recursive listings it is expected that directories have their path normalized [2]. [1] https://github.com/apache/arrow/blob/3eaa7dd0e8b3dabc5438203331f05e3e6c011e37/python/pyarrow/tests/test_fs.py#L688 [2] https:
| 679 | // [2] |
| 680 | // https://github.com/apache/arrow/blob/3eaa7dd0e8b3dabc5438203331f05e3e6c011e37/cpp/src/arrow/filesystem/test_util.cc#L767 |
| 681 | static FileInfo ToFileInfo(const std::string& full_path, |
| 682 | const gcs::ObjectMetadata& meta, |
| 683 | bool normalize_directories = false) { |
| 684 | if (IsDirectory(meta) || (!full_path.empty() && full_path.back() == '/')) { |
| 685 | if (normalize_directories) { |
| 686 | auto normalized = std::string(internal::RemoveTrailingSlash(full_path)); |
| 687 | return FileInfo(std::move(normalized), FileType::Directory); |
| 688 | } else { |
| 689 | return FileInfo(full_path, FileType::Directory); |
| 690 | } |
| 691 | } |
| 692 | auto info = FileInfo(full_path, FileType::File); |
| 693 | info.set_size(static_cast<int64_t>(meta.size())); |
| 694 | // An object has multiple "time" attributes, including the time when its data was |
| 695 | // created, and the time when its metadata was last updated. We use the object |
| 696 | // creation time because the data for an object cannot be changed once created. |
| 697 | info.set_mtime(meta.time_created()); |
| 698 | return info; |
| 699 | } |
| 700 | |
| 701 | GcsOptions options_; |
| 702 | gcs::Client client_; |
nothing calls this directly
no test coverage detected