Class MimeTypeHelper


  • @Immutable
    public final class MimeTypeHelper
    extends Object
    Contains some utility methods for handling MIME types.
    Author:
    Philip Helger
    • Method Detail

      • getCharsetNameFromMimeType

        @Nullable
        public static String getCharsetNameFromMimeType​(@Nullable
                                                        IMimeType aMimeType)
        Determine the charset name from the provided MIME type.
        Parameters:
        aMimeType - The MIME type to query. May be null.
        Returns:
        null if no MIME type was provided or if the MIME type does not contain a "charset" parameter
      • getCharsetFromMimeType

        @Nullable
        public static Charset getCharsetFromMimeType​(@Nullable
                                                     IMimeType aMimeType)
        Determine the charset from the provided MIME type.
        Parameters:
        aMimeType - The MIME type to query. May be null.
        Returns:
        null if no MIME type was provided or if the MIME type does not contain a "charset" parameter or if the provided charset name is invalid.