CommandResult runCommand(@NotNull OutputType outputType, String... commands) throws OSFileAssociationException {
    GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine.setExePath(UTIL_PATH);
    for (String command : commands) {
      if (OutputType.XML.equals(outputType)) {
        commandLine.addParameter("-x");
      }
      commandLine.addParameter("-c");
      commandLine.addParameter(command);
    }
    commandLine.addParameter(PLIST_PATH);
    StringBuilder errorMessage = new StringBuilder();
    StringBuilder output = new StringBuilder();
    try {
      OSProcessHandler processHandler = new OSProcessHandler(commandLine);
      processHandler.addProcessListener(new ProcessAdapter() {
        @Override
        public void onTextAvailable(@NotNull ProcessEvent event,
                                    @NotNull Key outputType) {
          if (ProcessOutputTypes.STDOUT.equals(outputType)) {
            output.append(event.getText());
          }
          if (ProcessOutputTypes.STDERR.equals(outputType)) {
            errorMessage.append(event.getText());
          }
        }
      });
      processHandler.startNotify();
      if (!processHandler.waitFor(1000)) {
        throw new OSFileAssociationException("Failed to run update-mime-database in 1 sec");
      }
      if (!errorMessage.isEmpty()) {
        throw new OSFileAssociationException("PListBuddy returned: " + errorMessage);
      }
      return new CommandResult(ObjectUtils.notNull(processHandler.getExitCode(), -1), output.toString());
    }
    catch (ExecutionException exe) {
      throw new OSFileAssociationException("Can't run PListBuddy: " + exe.getLocalizedMessage());
    }
  }
CommandResult runCommand(@NotNull OutputType outputType, String... commands)