Search Results for

    Show / Hide Table of Contents

    Class FileExtensionContentTypeProvider

    Provides a mapping between file extensions and MIME types.

    Inheritance
    System.Object
    FileExtensionContentTypeProvider
    Namespace: PnP.Framework.Utilities
    Assembly: PnP.Framework.dll
    Syntax
    public class FileExtensionContentTypeProvider : object

    Constructors

    FileExtensionContentTypeProvider()

    Creates a new provider with a set of default mappings.

    Declaration
    public FileExtensionContentTypeProvider()

    FileExtensionContentTypeProvider(IDictionary<String, String>)

    Creates a lookup engine using the provided mapping. It is recommended that the IDictionary instance use StringComparer.OrdinalIgnoreCase.

    Declaration
    public FileExtensionContentTypeProvider(IDictionary<string, string> mapping)
    Parameters
    IDictionary<System.String, System.String> mapping

    Properties

    Mappings

    The cross reference table of file extensions and content-types.

    Declaration
    public IDictionary<string, string> Mappings { get; }
    Property Value
    IDictionary<System.String, System.String>

    Methods

    TryGetContentType(String, out String)

    Given a file path, determine the MIME type

    Declaration
    public bool TryGetContentType(string subpath, out string contentType)
    Parameters
    System.String subpath

    A file path

    System.String contentType

    The resulting MIME type

    Returns
    System.Boolean

    True if MIME type could be determined

    Extension Methods

    ValidationExtensions.ValidateNotNullOrEmpty<T>(T, String)
    ObjectExtensions.Set<TObject, T>(TObject, Expression<Func<TObject, T>>, T, Boolean, Boolean)
    ObjectExtensions.GetPublicInstancePropertyValue(Object, String)
    ObjectExtensions.GetPublicInstanceProperty(Object, String)
    ObjectExtensions.SetPublicInstancePropertyValue(Object, String, Object)
    Extensions.ToByteArray(Object)
    Back to top PnP Framework
    Generated by DocFX with Material UI
    spacer