Class ContentTypeUtils

java.lang.Object
org.thymeleaf.util.ContentTypeUtils

public final class ContentTypeUtils extends Object

Utility class containing methods for computing content type-related data.

This class is internal and should not be used from users code.

Since:
3.0.6
  • Field Details

    • MIME_TYPES_HTML

      private static final String[] MIME_TYPES_HTML
    • MIME_TYPES_XML

      private static final String[] MIME_TYPES_XML
    • MIME_TYPES_RSS

      private static final String[] MIME_TYPES_RSS
    • MIME_TYPES_ATOM

      private static final String[] MIME_TYPES_ATOM
    • MIME_TYPES_JAVASCRIPT

      private static final String[] MIME_TYPES_JAVASCRIPT
    • MIME_TYPES_JSON

      private static final String[] MIME_TYPES_JSON
    • MIME_TYPES_CSS

      private static final String[] MIME_TYPES_CSS
    • MIME_TYPES_TEXT

      private static final String[] MIME_TYPES_TEXT
    • MIME_TYPES_SSE

      private static final String[] MIME_TYPES_SSE
    • FILE_EXTENSIONS_HTML

      private static final String[] FILE_EXTENSIONS_HTML
    • FILE_EXTENSIONS_XML

      private static final String[] FILE_EXTENSIONS_XML
    • FILE_EXTENSIONS_RSS

      private static final String[] FILE_EXTENSIONS_RSS
    • FILE_EXTENSIONS_ATOM

      private static final String[] FILE_EXTENSIONS_ATOM
    • FILE_EXTENSIONS_JAVASCRIPT

      private static final String[] FILE_EXTENSIONS_JAVASCRIPT
    • FILE_EXTENSIONS_JSON

      private static final String[] FILE_EXTENSIONS_JSON
    • FILE_EXTENSIONS_CSS

      private static final String[] FILE_EXTENSIONS_CSS
    • FILE_EXTENSIONS_TEXT

      private static final String[] FILE_EXTENSIONS_TEXT
    • NORMALIZED_MIME_TYPES

      private static final Map<String,String> NORMALIZED_MIME_TYPES
    • MIME_TYPE_BY_FILE_EXTENSION

      private static final Map<String,String> MIME_TYPE_BY_FILE_EXTENSION
    • TEMPLATE_MODE_BY_MIME_TYPE

      private static final Map<String,TemplateMode> TEMPLATE_MODE_BY_MIME_TYPE
  • Constructor Details

    • ContentTypeUtils

      private ContentTypeUtils()
  • Method Details

    • isContentTypeHTML

      public static boolean isContentTypeHTML(String contentType)
    • isContentTypeXML

      public static boolean isContentTypeXML(String contentType)
    • isContentTypeRSS

      public static boolean isContentTypeRSS(String contentType)
    • isContentTypeAtom

      public static boolean isContentTypeAtom(String contentType)
    • isContentTypeJavaScript

      public static boolean isContentTypeJavaScript(String contentType)
    • isContentTypeJSON

      public static boolean isContentTypeJSON(String contentType)
    • isContentTypeCSS

      public static boolean isContentTypeCSS(String contentType)
    • isContentTypeText

      public static boolean isContentTypeText(String contentType)
    • isContentTypeSSE

      public static boolean isContentTypeSSE(String contentType)
    • isContentType

      private static boolean isContentType(String contentType, String matcher)
    • computeTemplateModeForContentType

      public static TemplateMode computeTemplateModeForContentType(String contentType)
    • computeTemplateModeForTemplateName

      public static TemplateMode computeTemplateModeForTemplateName(String templateName)
    • computeTemplateModeForRequestPath

      public static TemplateMode computeTemplateModeForRequestPath(String requestPath)
    • hasRecognizedFileExtension

      public static boolean hasRecognizedFileExtension(String templateName)
    • computeContentTypeForTemplateName

      public static String computeContentTypeForTemplateName(String templateName, Charset charset)
    • computeContentTypeForRequestPath

      public static String computeContentTypeForRequestPath(String requestPath, Charset charset)
    • computeCharsetFromContentType

      public static Charset computeCharsetFromContentType(String contentType)
    • computeFileExtensionFromTemplateName

      private static String computeFileExtensionFromTemplateName(String templateName)
    • computeFileExtensionFromRequestPath

      private static String computeFileExtensionFromRequestPath(String requestPath)
    • combineContentTypeAndCharset

      public static String combineContentTypeAndCharset(String contentType, Charset charset)