Class Mimetype


  • public class Mimetype
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Mimetype()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getMimeType​(java.lang.String extension)
      As the tika library gives two warnings I decided to implement if manually for all the supported document formats (not a lot).
      • Methods inherited from class java.lang.Object

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

      • Mimetype

        public Mimetype()
    • Method Detail

      • getMimeType

        public static java.lang.String getMimeType​(java.lang.String extension)
                                            throws java.lang.Exception
        As the tika library gives two warnings I decided to implement if manually for all the supported document formats (not a lot). I didn't find any better option for the moment.
        Parameters:
        extension - Extension of the file to find the mimetype.
        Returns:
        Mimetype of the file.
        Throws:
        java.lang.Exception - If the file type is not supported (cannot find the mimetype).