| 330 | } |
| 331 | |
| 332 | Result<std::string> SubTreeFileSystem::StripBase(const std::string& s) const { |
| 333 | auto len = base_path_.length(); |
| 334 | // Note base_path_ ends with a slash (if not empty) |
| 335 | if (s.length() >= len && s.substr(0, len) == base_path_) { |
| 336 | return s.substr(len); |
| 337 | } else { |
| 338 | return Status::UnknownError("Underlying filesystem returned path '", s, |
| 339 | "', which is not a subpath of '", base_path_, "'"); |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | Status SubTreeFileSystem::FixInfo(FileInfo* info) const { |
| 344 | ARROW_ASSIGN_OR_RAISE(auto fixed_path, StripBase(info->path())); |
nothing calls this directly
no test coverage detected