Class ContentType


  • public class ContentType
    extends java.lang.Object
    Content-Type header constants and utility methods.
    • Method Detail

      • stripMediaType

        @Nullable
        public static java.lang.String stripMediaType​(@Nullable
                                                      java.lang.String contentType)
        Extract Media Type from a Content-Type header.
        Parameters:
        contentType - Content-Type header value
        Returns:
        Media Type
      • isKnownType

        public static boolean isKnownType​(@Nullable
                                          java.lang.String mediaType)
        Check if the Media Type is known.
        Parameters:
        mediaType - Media Type value
        Returns:
        true if the Media Type is known, false otherwise
      • isValidType

        public static boolean isValidType​(@Nullable
                                          java.lang.String mediaType)
        Check if the Media Type is valid.
        Parameters:
        mediaType - Media Type value
        Returns:
        true if the Media Type is valid, false otherwise