describeObject method

Future<DescribeObjectResponse> describeObject({
  1. required String path,
})

Gets the headers for an object at the specified path.

May throw ContainerNotFoundException. May throw InternalServerError. May throw ObjectNotFoundException.

Parameter path : The path (including the file name) where the object is stored in the container. Format:

Implementation

Future<DescribeObjectResponse> describeObject({
  required String path,
}) async {
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'HEAD',
    requestUri: '/${path.split('/').map(Uri.encodeComponent).join('/')}',
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return DescribeObjectResponse(
    cacheControl:
        _s.extractHeaderStringValue(response.headers, 'Cache-Control'),
    contentLength:
        _s.extractHeaderIntValue(response.headers, 'Content-Length'),
    contentType:
        _s.extractHeaderStringValue(response.headers, 'Content-Type'),
    eTag: _s.extractHeaderStringValue(response.headers, 'ETag'),
    lastModified:
        _s.extractHeaderDateTimeValue(response.headers, 'Last-Modified'),
  );
}