statObject method
Stat information of the object.
Implementation
Future<StatObjectResult> statObject(
String bucket,
String object, {
bool retrieveACLs = true,
}) async {
MinioInvalidBucketNameError.check(bucket);
MinioInvalidObjectNameError.check(object);
final resp = await _client.request(
method: 'HEAD',
bucket: bucket,
object: object,
);
validate(resp, expect: 200);
var etag = resp.headers['etag'];
if (etag != null) {
etag = trimDoubleQuote(etag);
}
return StatObjectResult(
etag: etag,
size: int.parse(resp.headers['content-length']!),
metaData: extractMetadata(resp.headers),
lastModified: parseRfc7231Time(resp.headers['last-modified']!),
acl: retrieveACLs ? await getObjectACL(bucket, object) : null,
);
}