@Nullable
  private static String getUriByExtension(@NotNull String extension) throws IOException, ExecutionException, OSFileAssociationException {
    File file = FileUtil.createTempFile("content_", "." + extension);
    GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine.setExePath("/usr/bin/mdls");
    commandLine.addParameter("-name");
    commandLine.addParameter(CONTENT_TYPE_ATTR);
    commandLine.addParameter(file.getPath());
    Ref<String> contentTypeValue = Ref.create();
    OSProcessHandler handler = new OSProcessHandler(commandLine);
    StringBuilder errMessage = new StringBuilder();
    handler.addProcessListener(new ProcessAdapter() {
      @Override
      public void onTextAvailable(@NotNull ProcessEvent event,
                                  @NotNull Key outputType) {
        if (ProcessOutputTypes.STDERR.equals(outputType)) {
          errMessage.append(event.getText());
        }
        else if (ProcessOutputTypes.STDOUT.equals(outputType)) {
          String text = event.getText();
          if (text.contains(CONTENT_TYPE_ATTR)) {
            contentTypeValue.set(extractContentTypeValue(text));
          }
        }
      }
    });
    handler.startNotify();
    if (!handler.waitFor(1000)) {
      throw new OSFileAssociationException("Failed to run mdls within 1 sec");
    }
    if (handler.getExitCode() != null && handler.getExitCode() != 0) {
      throw new OSFileAssociationException("mdls failed with exit code " + handler.getExitCode()
                                           + ", error message: " + errMessage);
    }
    return contentTypeValue.get();
  }
@Nullable
  private static String getUriByExtension(@NotNull String extension)