Table of Contents

Class MediaFileHelper

Namespace
Geotab.Checkmate.ObjectModel.Files
Assembly
Geotab.Checkmate.ObjectModel.dll

Stores accepted MediaFile extensions and related methods

public static class MediaFileHelper
Inheritance
MediaFileHelper
Inherited Members

Methods

GetAllSupportedTypes()

Returns all Supported Image, Video and Applicaion types in one HashSet

public static HashSet<string> GetAllSupportedTypes()

Returns

HashSet<string>

HashSet of all supported types, image, video and application

GetContentTypeByExtension(string)

Returns the Content type based on extension passed to it

public static string GetContentTypeByExtension(string extension)

Parameters

extension string

The extension.

Returns

string

contentType - "{image/video/application}/{extension}"

GetMediaTypeFromExtension(string)

Get the MediaType from a provided extension

public static MediaType GetMediaTypeFromExtension(string extension)

Parameters

extension string

The extension.

Returns

MediaType

MediaType

ValidateRequest(string, string)

Ensures that the content type matches the extension. Throws an error if does not match

public static void ValidateRequest(string extension, string contentType)

Parameters

extension string

The extension.

contentType string

The contentType.