MimeTypeResolver class

MIME-type resolver class, used to customize the lookup of mime-types.

Constructors

MimeTypeResolver()
Create a new MimeTypeResolver containing the default scope.
MimeTypeResolver.empty()
Create a new empty MimeTypeResolver.

Properties

hashCode → int
The hash code for this object.
no setterinherited
magicNumbersMaxLength → int
Get the maximum number of bytes required to match all magic numbers, when performing lookup with headerBytes present.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addExtension(String extension, String mimeType) → void
Add a new MIME-type mapping to the MimeTypeResolver. If the extension is already present in the MimeTypeResolver, it'll be overwritten.
addMagicNumber(List<int> bytes, String mimeType, {List<int>? mask}) → void
Add a new magic-number mapping to the MimeTypeResolver.
lookup(String path, {List<int>? headerBytes}) → String?
Extract the extension from path and use that for MIME-type lookup.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited