Class ContentTypeUtil
Utility functions regarding ContentTypes
Inherited Members
Namespace: ImageVault.Core.Conversion
Assembly: ImageVault.Core.dll
Syntax
[Obsolete("Use ImageVault.Common.Lib.Web.ContentTypeUtil instead")]
public static class ContentTypeUtil
Fields
ApplicationJson
application/json content type
Declaration
public const string ApplicationJson = "application/json"
Field Value
Type | Description |
---|---|
String |
ApplicationOctetStream
Gets the content-type for ApplicationOctetStream
Declaration
public const string ApplicationOctetStream = "application/octet-stream"
Field Value
Type | Description |
---|---|
String |
ApplicationPdf
Gets the ApplicationPdf of the ContentTypeUtil
Declaration
public const string ApplicationPdf = "application/pdf"
Field Value
Type | Description |
---|---|
String |
ApplicationPostscript
Get/Sets the ApplicationPostscript of the ContentTypeUtil
Declaration
public const string ApplicationPostscript = "application/postscript"
Field Value
Type | Description |
---|---|
String |
ApplicationZip
Gets the content-type for ApplicationZip
Declaration
public const string ApplicationZip = "application/zip"
Field Value
Type | Description |
---|---|
String |
ImageEps
Gets the content-type for ImageEps
Declaration
public const string ImageEps = "image/eps"
Field Value
Type | Description |
---|---|
String |
ImageGif
Gets the content-type for ImageGif
Declaration
public const string ImageGif = "image/gif"
Field Value
Type | Description |
---|---|
String |
ImageJpeg
Gets the content-type for ImageJpeg
Declaration
public const string ImageJpeg = "image/jpeg"
Field Value
Type | Description |
---|---|
String |
ImageJpg
Gets the content-type for ImageJpg
Declaration
public const string ImageJpg = "image/jpg"
Field Value
Type | Description |
---|---|
String |
ImagePng
Gets the content-type for ImagePng
Declaration
public const string ImagePng = "image/png"
Field Value
Type | Description |
---|---|
String |
ImageSvg
The svg content type
Declaration
public const string ImageSvg = "image/svg+xml"
Field Value
Type | Description |
---|---|
String |
Remarks
ImageTiff
Gets the content-type for ImageTiff
Declaration
public const string ImageTiff = "image/tiff"
Field Value
Type | Description |
---|---|
String |
MediaUnknown
Gets the content-type for MediaUnknown
Declaration
public const string MediaUnknown = "media/unknown"
Field Value
Type | Description |
---|---|
String |
TextPlain
Gets the TextPlain of the ContentTypeUtil
Declaration
public const string TextPlain = "text/plain"
Field Value
Type | Description |
---|---|
String |
VideoMp4
Gets the video/mp4 content type
Declaration
public const string VideoMp4 = "video/mp4"
Field Value
Type | Description |
---|---|
String |
Methods
CalculateContentType(MediaFormatOutputTypes, String)
Calculates the content type based on a conversion format type and an original content type
Declaration
public static string CalculateContentType(MediaFormatOutputTypes mediaFormatOutputType, string originalContentType)
Parameters
Type | Name | Description |
---|---|---|
MediaFormatOutputTypes | mediaFormatOutputType | The MediaFormatOutputTypes to calculate the content type for |
String | originalContentType | The original content type of the media |
Returns
Type | Description |
---|---|
String |
GetSubType(String)
Gets the subtype of the supplied content type
Declaration
public static string GetSubType(string contentType)
Parameters
Type | Name | Description |
---|---|---|
String | contentType | The content type to get subtype for |
Returns
Type | Description |
---|---|
String | The subtype of the content type (type/subtype) |
GetType(String)
Gets the type of the supplied content type
Declaration
public static string GetType(string contentType)
Parameters
Type | Name | Description |
---|---|---|
String | contentType | The content type to get type for |
Returns
Type | Description |
---|---|
String | The type of the content type (type/subtype) |
IsImage(String)
Checks if the supplied content type is an image
Declaration
public static bool IsImage(string contentType)
Parameters
Type | Name | Description |
---|---|---|
String | contentType |
Returns
Type | Description |
---|---|
System.Boolean | True if it is image, otherwise false. |
IsVideo(String)
Checks if the supplied content type is a video
Declaration
public static bool IsVideo(string contentType)
Parameters
Type | Name | Description |
---|---|---|
String | contentType |
Returns
Type | Description |
---|---|
System.Boolean | True if it is video, otherwise false. |
IsWebSafe(String)
Checks if a supplied ContentType is websafe or not
Declaration
public static bool IsWebSafe(string contentType)
Parameters
Type | Name | Description |
---|---|---|
String | contentType | The content type to check |
Returns
Type | Description |
---|---|
System.Boolean | True if web is safe, otherwise false. |