Class MimeTypeHelper


  • public class MimeTypeHelper
    extends Object
    Since:
    2015-01-28
    Version:
    $Id$
    Author:
    cngo
    • Method Detail

      • sanitizeMimeType

        public static String sanitizeMimeType​(String mimeType)
        Mimetypes can be a tricky thing as browsers and/or environments tend to alter them without good reason. This method will try to fix any of the quirks concerning mimetypes that are found out there.
        Parameters:
        mimeType - The mimetype that needs to be sanitized.
        Returns:
        A standard compliant mimetype in lowercase
      • isImageMimeType

        public static boolean isImageMimeType​(String mimeType)
        Checks whether the given MIME type indicates an image.
        Parameters:
        mimeType - the MIME type to check
        Returns:
        true if the given MIME type indicates an image, false otherwise.
      • isSvgMimeType

        public static boolean isSvgMimeType​(String mimeType)
      • isPdfMimeType

        public static boolean isPdfMimeType​(String mimeType)
      • isJpegMimeType

        public static boolean isJpegMimeType​(String mimeType)