Table of Contents

Class MimeType

Namespace
Steeltoe.Common.Util
Assembly
Steeltoe.Common.dll
public class MimeType : IComparable<MimeType>
Inheritance
MimeType
Implements
Inherited Members

Constructors

MimeType(MimeType, IDictionary<string, string>)

public MimeType(MimeType other, IDictionary<string, string> parameters = null)

Parameters

other MimeType
parameters IDictionary<string, string>

MimeType(MimeType, Encoding)

public MimeType(MimeType other, Encoding charset)

Parameters

other MimeType
charset Encoding

MimeType(string)

public MimeType(string type)

Parameters

type string

MimeType(string, string)

public MimeType(string type, string subtype)

Parameters

type string
subtype string

MimeType(string, string, IDictionary<string, string>)

public MimeType(string type, string subtype, IDictionary<string, string> parameters)

Parameters

type string
subtype string
parameters IDictionary<string, string>

MimeType(string, string, Encoding)

public MimeType(string type, string subtype, Encoding charset)

Parameters

type string
subtype string
charset Encoding

Fields

WILDCARD_TYPE

public const string WILDCARD_TYPE = "*"

Field Value

string

Properties

Encoding

public Encoding Encoding { get; }

Property Value

Encoding

IsConcrete

public bool IsConcrete { get; }

Property Value

bool

IsWildcardSubtype

public bool IsWildcardSubtype { get; }

Property Value

bool

IsWildcardType

public bool IsWildcardType { get; }

Property Value

bool

Parameters

public IDictionary<string, string> Parameters { get; }

Property Value

IDictionary<string, string>

Subtype

public string Subtype { get; }

Property Value

string

Type

public string Type { get; }

Property Value

string

Methods

CheckParameters(string, string)

protected void CheckParameters(string attribute, string value)

Parameters

attribute string
value string

CompareTo(MimeType)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(MimeType other)

Parameters

other MimeType

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object other)

Parameters

other object

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

EqualsTypeAndSubtype(MimeType)

public bool EqualsTypeAndSubtype(MimeType other)

Parameters

other MimeType

Returns

bool

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetParameter(string)

public string GetParameter(string name)

Parameters

name string

Returns

string

Includes(MimeType)

public bool Includes(MimeType other)

Parameters

other MimeType

Returns

bool

IsCompatibleWith(MimeType)

public bool IsCompatibleWith(MimeType other)

Parameters

other MimeType

Returns

bool

IsPresentIn<T>(ICollection<T>)

public bool IsPresentIn<T>(ICollection<T> mimeTypes) where T : MimeType

Parameters

mimeTypes ICollection<T>

Returns

bool

Type Parameters

T

ToMimeType(string)

public static MimeType ToMimeType(string value)

Parameters

value string

Returns

MimeType

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Unquote(string)

protected string Unquote(string s)

Parameters

s string

Returns

string