open class PathExtensionContentNegotiationStrategy : AbstractMappingContentNegotiationStrategy
A ContentNegotiationStrategy
that resolves the file extension in the request path to a key to be used to look up a media type.
If the file extension is not found in the explicit registrations provided to the constructor, the MediaTypeFactory is used as a fallback mechanism.
Author
Rossen Stoyanchev
Since
3.2
PathExtensionContentNegotiationStrategy()
Create an instance without any mappings to start with. Mappings may be added later on if any extensions are resolved through the Java Activation framework. PathExtensionContentNegotiationStrategy(mediaTypes: MutableMap<String, MediaType>)
Create an instance with the given map of file extensions and media types. |
open fun getMediaTypeForResource(resource: Resource): MediaType
A public method exposing the knowledge of the path extension strategy to resolve file extensions to a MediaType in this case for a given Resource. The method first looks up any explicitly registered file extensions first and then falls back on MediaTypeFactory if available. |
|
open fun setUrlPathHelper(urlPathHelper: UrlPathHelper): Unit
Configure a |
|
open fun setUseJaf(useJaf: Boolean): Unit |
open class ServletPathExtensionContentNegotiationStrategy : PathExtensionContentNegotiationStrategy
Extends |