code: public String getMimeType()
     {
        if (mediaType == null || untrustedAgent)
        {
           return mimeTypeResolver.getMimeType(fileName);
        }
  
        return mediaType.getType() + "/" + mediaType.getSubtype();
     }
docs: Returns mime-type of a resource according to {@link MediaType}
  or {@link MimeTypeResolver} information.