C# Class Tp.Utils.Mime.MimeTypes

Summary description for MimeTypes.
Mostrar archivo Open project: TargetProcess/Target-Process-Plugins Class Usage Examples

Public Methods

Method Description
ForName ( String name ) : MimeType

Return a MimeType from its name.

Get ( string filepath ) : MimeTypes

Return a MimeTypes instance.

GetMimeType ( Uri url ) : MimeType

Find the Mime Content Type of a document from its URL.

GetMimeType ( string name ) : MimeType

Find the Mime Content Type of a document from its name.

GetMimeTypeByContent ( Stream data ) : MimeType

Find the Mime Content Type of a stream from its content.

GetMimeTypeByExtension ( string name ) : MimeType
MimeTypes ( ) : System
MimeTypes ( string strFilepath ) : System

Should never be instanciated from outside

Private Methods

Method Description
Add ( MimeType types ) : void

Add the specified mime-types in the repository.

GetMimeTypes ( string name ) : Tp.Utils.Mime.MimeType[]

Returns an array of matching MimeTypes from the specified name (many MimeTypes can have the same registered extensions).

Method Details

ForName() public method

Return a MimeType from its name.
public ForName ( String name ) : MimeType
name String
return MimeType

Get() public static method

Return a MimeTypes instance.
public static Get ( string filepath ) : MimeTypes
filepath string is the mime-types definitions xml file. ///
return MimeTypes

GetMimeType() public method

Find the Mime Content Type of a document from its URL.
public GetMimeType ( Uri url ) : MimeType
url System.Uri of the document to analyze. ///
return MimeType

GetMimeType() public method

Find the Mime Content Type of a document from its name.
public GetMimeType ( string name ) : MimeType
name string of the document to analyze. ///
return MimeType

GetMimeTypeByContent() public method

Find the Mime Content Type of a stream from its content.
public GetMimeTypeByContent ( Stream data ) : MimeType
data Stream are the first bytes of data of the content to analyze. /// Depending on the length of provided data, all known MimeTypes are /// checked. If the length of provided data is greater or egals to /// the value returned by {@link #getMinLength()}, then all known /// MimeTypes are checked, otherwise only the MimeTypes that could be /// analyzed with the length of provided data are analyzed. /// ///
return MimeType

GetMimeTypeByExtension() public method

public GetMimeTypeByExtension ( string name ) : MimeType
name string
return MimeType

MimeTypes() public method

public MimeTypes ( ) : System
return System

MimeTypes() public method

Should never be instanciated from outside
public MimeTypes ( string strFilepath ) : System
strFilepath string
return System