Class MappingMediaTypeFileExtensionResolver

java.lang.Object
org.springframework.web.accept.MappingMediaTypeFileExtensionResolver
All Implemented Interfaces:
MediaTypeFileExtensionResolver
Direct Known Subclasses:
AbstractMappingContentNegotiationStrategy

public class MappingMediaTypeFileExtensionResolver extends Object implements MediaTypeFileExtensionResolver
An implementation of MediaTypeFileExtensionResolver that maintains lookups between file extensions and MediaTypes in both directions.

Initially created with a map of file extensions and media types. Subsequently subclasses can use addMapping(java.lang.String, org.springframework.http.MediaType) to add more mappings.

Since:
3.2
Author:
Rossen Stoyanchev, Juergen Hoeller
  • Constructor Details

    • MappingMediaTypeFileExtensionResolver

      public MappingMediaTypeFileExtensionResolver(@Nullable Map<String,MediaType> mediaTypes)
      Create an instance with the given map of file extensions and media types.
  • Method Details