Class MediaTypeUtil


  • public class MediaTypeUtil
    extends Object
    Used to map file extensions to Mime types from a properties file
    Author:
    OpenCollab
    • Constructor Detail

      • MediaTypeUtil

        public MediaTypeUtil()
    • Method Detail

      • getMediaTypeFromExt

        public static String getMediaTypeFromExt​(String ext)
        Returns the correct media type for a specific file extension
        Parameters:
        ext - the file extension
        Returns:
        the mime type
      • getMediaTypeFromFilename

        public static String getMediaTypeFromFilename​(String fileName)
        Returns the correct media type for a specific file name
        Parameters:
        fileName - the full filename
        Returns:
        the mime type
      • setMediaTypeMap

        public static void setMediaTypeMap​(Map<String,​String> aMediaTypeMap)
        Allows you to override the media type map
        Parameters:
        aMediaTypeMap - the mediaTypeMap to set