mimeType method

  1. @override
Future<String?> mimeType(
  1. String path
)

Determine the mime type for the given file.

Implementation

@override
Future<String?> mimeType(String path) {
  return _attempt<String?>(null, () async {
    final metadata = (await bucket.head(_objectKey(path)))?.httpMetadata;
    return metadata?['contentType'] ?? metadata?['content-type'];
  });
}