org.springframework.web.accept

Class MappingMediaTypeFileExtensionResolver

  • java.lang.Object
    • org.springframework.web.accept.MappingMediaTypeFileExtensionResolver
    • Constructor Detail

      • MappingMediaTypeFileExtensionResolver

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

      • getMediaTypes

        public java.util.Map<java.lang.String,MediaType> getMediaTypes()
      • getAllMediaTypes

        protected java.util.List<MediaType> getAllMediaTypes()
      • addMapping

        protected void addMapping(java.lang.String extension,
                                  MediaType mediaType)
        Map an extension to a MediaType. Ignore if extension already mapped.
      • lookupMediaType

        @Nullable
        protected MediaType lookupMediaType(java.lang.String extension)
        Use this method for a reverse lookup from extension to MediaType.
        Returns:
        a MediaType for the key, or null if none found