getCollection static method
Future<CollectionFrameResponse>
getCollection(
- P2PStream stream, {
- required PeerId ownerPeerId,
- required String path,
Get collection metadata
Implementation
static Future<CollectionFrameResponse> getCollection(
P2PStream stream, {
required PeerId ownerPeerId,
required String path,
}) async {
try {
final requestBytes = CollectionFrame.encodeRequest(
operation: 'GET',
ownerPeerId: ownerPeerId,
path: path,
);
await _writeFrameStatic(stream, requestBytes);
final responseBytes = await _readFrameStatic(stream);
return CollectionFrame.decodeResponse(responseBytes);
} catch (e, stackTrace) {
_logger.severe('Error getting collection: $e', e, stackTrace);
rethrow;
}
}