PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.MIMEType Class Reference

Kept to maintain legacy code. More...

Static Public Member Functions

static string GuessForFileName (string fileNameOrExtension)
 Tries to get the type of the MIME from the provided string.
static bool TryGuessExtensionForMimeType (string mimeType, out string extension)
 Gets the extension from the provided MINE type.
static bool IsTextMIMEType (this string mimeType)
 Returns true for all text mime types: text/* *‍/xml *+xml.

Properties

static string[] KnownFileExtensions [get]
 A list of all known file extensions for MIMEType.
static string[] KnownMimeTypes [get]
 A list of all known MIME types for MIMEType.

Detailed Description

Kept to maintain legacy code.

Member Function Documentation

◆ GuessForFileName()

string PeanutButter.Utils.MIMEType.GuessForFileName ( string fileNameOrExtension)
static

Tries to get the type of the MIME from the provided string.

Parameters
fileNameOrExtensionThe filename or extension.
Returns
The MIME type.
Exceptions
ArgumentNullException

◆ IsTextMIMEType()

bool PeanutButter.Utils.MIMEType.IsTextMIMEType ( this string mimeType)
static

Returns true for all text mime types: text/* *‍/xml *+xml.

Parameters
mimeType
Returns

◆ TryGuessExtensionForMimeType()

bool PeanutButter.Utils.MIMEType.TryGuessExtensionForMimeType ( string mimeType,
out string extension )
static

Gets the extension from the provided MINE type.

Parameters
mimeTypeType of the MIME.
extensionThe resolved extension, if found.
Exceptions
ArgumentNullException
Exceptions
ArgumentException

The documentation for this class was generated from the following file:
  • source/Utils/PeanutButter.Utils/MimeTypes.cs