Skip to content

interface IContentTypeProvider

cangjie
public interface IContentTypeProvider

功能:提供静态资源路径到内容类型的映射能力。

成员概览

成员功能
func getContentType(String)根据路径解析对应的内容类型。

func getContentType(String)

cangjie
func getContentType(path: String): ?String

功能:根据路径解析对应的内容类型。

参数:

  • path: String - 要解析的资源路径。

返回值:

  • ?String - 匹配到的内容类型;未匹配时返回空。