|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.boot.context.embedded.MimeMappings
public final class MimeMappings
Simple container-independent abstraction for servlet mime mappings. Roughly equivalent to the <mime-mapping> element traditionally found in web.xml.
| Nested Class Summary | |
|---|---|
static class |
MimeMappings.Mapping
A single mime mapping. |
| Field Summary | |
|---|---|
static MimeMappings |
DEFAULT
Default mime mapping commonly used. |
| Constructor Summary | |
|---|---|
MimeMappings()
Create a new empty MimeMappings instance. |
|
MimeMappings(Map<String,String> mappings)
Create a new MimeMappings from the specified mappings. |
|
MimeMappings(MimeMappings mappings)
Create a new MimeMappings instance from the specified mappings. |
|
| Method Summary | |
|---|---|
String |
add(String extension,
String mimeType)
Add a new mime mapping. |
boolean |
equals(Object obj)
|
String |
get(String extension)
Get a mime mapping for the given extension. |
Collection<MimeMappings.Mapping> |
getAll()
Returns all defined mappings. |
int |
hashCode()
|
Iterator<MimeMappings.Mapping> |
iterator()
|
String |
remove(String extension)
Remove an existing mapping. |
static MimeMappings |
unmodifiableMappings(MimeMappings mappings)
Create a new unmodifiable view of the specified mapping. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final MimeMappings DEFAULT
| Constructor Detail |
|---|
public MimeMappings()
MimeMappings instance.
public MimeMappings(MimeMappings mappings)
MimeMappings instance from the specified mappings.
mappings - the source mappingspublic MimeMappings(Map<String,String> mappings)
MimeMappings from the specified mappings.
mappings - the source mappings with extension as the key and mime-type as the
value| Method Detail |
|---|
public Iterator<MimeMappings.Mapping> iterator()
iterator in interface Iterable<MimeMappings.Mapping>public Collection<MimeMappings.Mapping> getAll()
public String add(String extension,
String mimeType)
extension - the file extension (excluding '.')mimeType - the mime type to map
nullpublic String get(String extension)
extension - the file extension (excluding '.')
nullpublic String remove(String extension)
extension - the file extension (excluding '.')
null if no item was removedpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic static MimeMappings unmodifiableMappings(MimeMappings mappings)
UnsupportedOperationExceptions.
mappings - the mappings
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||