Class MimeUtils


  • public class MimeUtils
    extends java.lang.Object
    Mime type utilities.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.Map<java.lang.String,​java.lang.String> mimeFormats
      Map of registered mime file extension to media type in publishing server.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.lang.String get​(java.lang.String fileExtension)
      Deprecated.
      Since 4.1.7.
      static java.lang.String getMimeFormat​(java.lang.String filename)
      Gets a media type for a filename by extracting the extension and checking for registered type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mimeFormats

        public static final java.util.Map<java.lang.String,​java.lang.String> mimeFormats
        Map of registered mime file extension to media type in publishing server.
    • Method Detail

      • get

        @Deprecated
        public static java.lang.String get​(java.lang.String fileExtension)
        Deprecated.
        Since 4.1.7. Please use getMimeFormat(String) instead.
        Parameters:
        fileExtension -
        Returns:
      • getMimeFormat

        public static java.lang.String getMimeFormat​(java.lang.String filename)
        Gets a media type for a filename by extracting the extension and checking for registered type.
        Parameters:
        filename -
        Returns:
        media type as string or "application/octet-stream" if extension is empty or does not match any registered type.