类 MediaTypeFactory
java.lang.Object
cn.taketoday.http.MediaTypeFactory
A factory delegate for resolving
MediaType objects
from Resource handles or filenames.- 从以下版本开始:
- 4.0 2022/2/15 14:33
- 作者:
- Juergen Hoeller, Arjen Poutsma, Harry Yang
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明getMediaType(cn.taketoday.core.io.Resource resource) Determine a media type for the given resource, if possible.getMediaType(String filename) Determine a media type for the given file name, if possible.getMediaTypes(String filename) Determine the media types for the given file name, if possible.Parse themime.typesfile found in the resources.
-
字段详细资料
-
MIME_TYPES_FILE_NAME
- 另请参阅:
-
fileExtensionToMediaTypes
-
-
构造器详细资料
-
MediaTypeFactory
private MediaTypeFactory()
-
-
方法详细资料
-
parseMimeTypes
Parse themime.typesfile found in the resources. Format is:# comments begin with a '#'
# the format is <mime type> <space separated file extensions>
# for example:
text/plain txt text
# this would map file.txt and file.text to
# the mime type "text/plain"
- 返回:
- a multi-value map, mapping media types to file extensions.
-
getMediaType
Determine a media type for the given resource, if possible.- 参数:
resource- the resource to introspect- 返回:
- the corresponding media type, or
nullif none found
-
getMediaType
Determine a media type for the given file name, if possible.- 参数:
filename- the file name plus extension- 返回:
- the corresponding media type, or
nullif none found
-
getMediaTypes
Determine the media types for the given file name, if possible.- 参数:
filename- the file name plus extension- 返回:
- the corresponding media types, or an empty list if none found
-