Class MimeTypeUtil


  • public class MimeTypeUtil
    extends Object
    • Constructor Detail

      • MimeTypeUtil

        public MimeTypeUtil()
    • Method Detail

      • determineMimetype

        public static String determineMimetype​(ContentReader reader,
                                               org.springframework.extensions.webscripts.WebScriptRequest req,
                                               MimetypeService mimetypeService)
        Get the file mimetype from the file ContentReader, and if its null then set the mimetype to binary by default and try to get the correct one from file extension
        Parameters:
        reader - reader of the file in the request
        req - request relating to the file
        mimetypeService - MimetypeService
        Returns:
        mimetype of the file as a string