Returns a ContentType
for a file extension.
Returns the associated content type for extension
, if one exists. Extension may have leading '.',
e.g. both '.jpg' and 'jpg' are valid inputs to this method.
Returns null if there is no entry for extension
. Entries can be added with setContentTypeForExtension.
Source
ContentType contentTypeForExtension(String extension) { if (extension.startsWith(".")) { extension = extension.substring(1); } return _extensionMap[extension]; }