Class JsonFileChooserAcceptAttributeBuilder


  • @Bean
    public class JsonFileChooserAcceptAttributeBuilder
    extends Object
    Microsoft internet explorer is not correctly handlig mime types in the 'accept' atttribute.

    For example valid text/csv is not recognized.

    Therefore as a fallback for IE only we use file extensions for selected white-listed types.

    This bean builds the content of the accept attribute in <input accept="file_extension|audio/*|video/*|image/*|media_type">

    Since:
    5.2
    • Constructor Detail

      • JsonFileChooserAcceptAttributeBuilder

        public JsonFileChooserAcceptAttributeBuilder()
    • Method Detail

      • build

        public Set<String> build()
        Returns:
        the completed set of accept types
      • convertToAcceptType

        protected String convertToAcceptType​(String mimeType,
                                             String ext)
        Parameters:
        mimeType - never null
        ext - without leading '*' or '.'. May be null.
        Returns:
        the text used in the accept tag in the input element, never null

        typically this is the mime type or the file extension with a leading '.'