| 122 | } |
| 123 | |
| 124 | void FileSystemKeyMaterialStore::MoveMaterialTo( |
| 125 | std::shared_ptr<FileKeyMaterialStore> target_key_store) { |
| 126 | auto target_key_file_store = |
| 127 | std::dynamic_pointer_cast<FileSystemKeyMaterialStore>(target_key_store); |
| 128 | if (target_key_file_store == nullptr) { |
| 129 | throw ParquetException( |
| 130 | "Cannot move key material to a store that is not a FileSystemKeyMaterialStore"); |
| 131 | } |
| 132 | std::string target_key_material_file = target_key_file_store->GetStorageFilePath(); |
| 133 | auto status = file_system_->Move(key_material_file_path_, target_key_material_file); |
| 134 | if (!status.ok()) { |
| 135 | std::stringstream ss; |
| 136 | ss << "Failed to move key material file '" << key_material_file_path_ << "' to '" |
| 137 | << target_key_material_file << "': " << status; |
| 138 | throw ParquetException(ss.str()); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | } // namespace parquet::encryption |
no test coverage detected