docs: public static String getMediaTypeFromFile(final File file) {
      if (file == null) {
        return null;
      }
  
      final String fileName = file.getName();
      final int i = fileName.lastIndexOf('.');
  
      if (i == -1) {
        return null;
      }
  
      return MEDIA_TYPES.get(fileName.substring(i).toLowerCase());
    }