code: public static String getMime(@NotNull String file, String defaultMimeType) {
          int sep = file.lastIndexOf('.');
          if (sep != -1) {
              String extension = file.substring(sep + 1, file.length());
  
              String mime = mimes.get(extension);
  
              if (mime != null) {
                  return mime;
              }
          }
  
          return defaultMimeType;
      }
docs: Returns a mime type string by parsing the file extension of a file string. If the extension is not found or
  unknown the default value is returned.
  
  @param file            path to a file with extension
  @param defaultMimeType what to return if not found
  @return mime type