MimeUtils
public enum MimeUtils
Utilities for dealing with MIME types.
-
Returns true if the given case insensitive MIME type has an entry in the map.
Declaration
Swift
public static func hasMimeType(_ mimeType: String) -> BoolParameters
mimeTypemimeType A MIME type (i.e. text/plain)
Return Value
Boolif a extension has been registered for the given case insensitive MIME type. -
Returns the MIME type for the given case insensitive file extension.
Declaration
Swift
public static func mimeType(from fileExtension: String) -> String?Parameters
fileExtensionA file extension without the leading ‘.’
Return Value
The MIME type has been registered for the given case insensitive file extension or null if there is none.
-
Returns true if the given case insensitive extension has a registered MIME type.
Declaration
Swift
public static func hasExtension(_ fileExtension: String) -> BoolParameters
fileExtensionA file extension without the leading ‘.’
Return Value
True if a MIME type has been registered for the given case insensitive file extension.
-
Returns the registered extension for the given case insensitive MIME type. Note that some MIME types map to multiple extensions. This call will return the most common extension for the given MIME type.
Declaration
Swift
public static func fileExtension(from mimeType: String) -> String?Parameters
mimeTypeA MIME type (i.e. text/plain)
Return Value
The extension has been registered for the given case insensitive MIME type or null if there is none.
Install in Dash
MimeUtils Enumeration Reference