MIME type mapper. Based on: https://github.com/samuelneff/MimeTypeMap.
More...
|
| static bool | TryGetMimeType (string file, out string mimeType) |
| | Tries to get the type of the MIME from the provided string.
|
| |
| static string | GetMimeType (string file) |
| | Gets the type of the MIME from the provided string.
|
| |
| static bool | TryGetExtension (string mimeType, out string extension) |
| | Tries to get the file extension from the provided MIME type.
|
| |
| static string | GetExtension (string mimeType) |
| | Gets the file extension from the provided MIME type.
|
| |
|
| static readonly Lazy< IDictionary< string, string > > | _mappings = new(buildMappings) |
| |
◆ GetExtension()
| static string BogaNet.Util.MimeTypeMap.GetExtension |
( |
string | mimeType | ) |
|
|
static |
Gets the file extension from the provided MIME type.
- Parameters
-
- Returns
- The extension for the MIME type
- Exceptions
-
◆ GetMimeType()
| static string BogaNet.Util.MimeTypeMap.GetMimeType |
( |
string | file | ) |
|
|
static |
Gets the type of the MIME from the provided string.
- Parameters
-
| file | The filename or extension |
- Returns
- The MIME type
◆ TryGetExtension()
| static bool BogaNet.Util.MimeTypeMap.TryGetExtension |
( |
string | mimeType, |
|
|
out string | extension ) |
|
static |
Tries to get the file extension from the provided MIME type.
- Parameters
-
| mimeType | MIME type |
| extension | The variable to store the file extension |
- Returns
- True if the operation was successful
- Exceptions
-
◆ TryGetMimeType()
| static bool BogaNet.Util.MimeTypeMap.TryGetMimeType |
( |
string | file, |
|
|
out string | mimeType ) |
|
static |
Tries to get the type of the MIME from the provided string.
- Parameters
-
| file | The filename or extension |
| mimeType | The variable to store the MIME type |
- Returns
- True if the operation was successful
◆ _mappings
| readonly Lazy<IDictionary<string, string> > BogaNet.Util.MimeTypeMap._mappings = new(buildMappings) |
|
staticprotected |
The documentation for this class was generated from the following file:
- /Users/stefanlaubenberger/Projects/CSharp/BogaNet/BogaNet.Common/Util/MimeTypeMap.cs