类 MimeMappings
java.lang.Object
org.springframework.boot.web.server.MimeMappings
- 所有已实现的接口:
Iterable<MimeMappings.Mapping>
Simple server-independent abstraction for mime mappings. Roughly equivalent to the
<mime-mapping> element traditionally found in web.xml.
- 从以下版本开始:
- 2.0.0
- 作者:
- Phillip Webb, Guirong Hu
-
嵌套类概要
嵌套类 -
字段概要
字段 -
构造器概要
构造器构造器说明Create a new emptyMimeMappings
instance.MimeMappings
(Map<String, String> mappings) Create a newMimeMappings
from the specified mappings.MimeMappings
(MimeMappings mappings) Create a newMimeMappings
instance from the specified mappings. -
方法概要
修饰符和类型方法说明Add a new mime mapping.boolean
Get a mime mapping for the given extension.getAll()
Returns all defined mappings.int
hashCode()
final Iterator
<MimeMappings.Mapping> iterator()
static MimeMappings
lazyCopy
(MimeMappings mappings) Create a new lazy copy of the given mappings that will only copy entries if the mappings are mutated.Remove an existing mapping.static MimeMappings
unmodifiableMappings
(MimeMappings mappings) Create a new unmodifiable view of the specified mapping.从接口继承的方法 java.lang.Iterable
forEach, spliterator
-
字段详细资料
-
DEFAULT
Default mime mapping commonly used.
-
-
构造器详细资料
-
MimeMappings
public MimeMappings()Create a new emptyMimeMappings
instance. -
MimeMappings
Create a newMimeMappings
instance from the specified mappings.- 参数:
mappings
- the source mappings
-
MimeMappings
Create a newMimeMappings
from the specified mappings.- 参数:
mappings
- the source mappings with extension as the key and mime-type as the value
-
-
方法详细资料
-
add
Add a new mime mapping.- 参数:
extension
- the file extension (excluding '.')mimeType
- the mime type to map- 返回:
- any previous mapping or
null
-
remove
Remove an existing mapping.- 参数:
extension
- the file extension (excluding '.')- 返回:
- the removed mime mapping or
null
if no item was removed
-
get
Get a mime mapping for the given extension.- 参数:
extension
- the file extension (excluding '.')- 返回:
- a mime mapping or
null
-
getAll
Returns all defined mappings.- 返回:
- the mappings.
-
iterator
- 指定者:
iterator
在接口中Iterable<MimeMappings.Mapping>
-
equals
-
hashCode
public int hashCode() -
unmodifiableMappings
Create a new unmodifiable view of the specified mapping. Methods that attempt to modify the returned map will throwUnsupportedOperationException
s.- 参数:
mappings
- the mappings- 返回:
- an unmodifiable view of the specified mappings.
-
lazyCopy
Create a new lazy copy of the given mappings that will only copy entries if the mappings are mutated.- 参数:
mappings
- the source mappings- 返回:
- a new mappings instance
- 从以下版本开始:
- 3.0.0
-