public List<ValidationResult> validate(File rootDir, UpdaterUI ui) throws IOException, OperationCancelledException {
    File toDir = toBaseDir(rootDir);

    if (myIsStrict) {
      // in the strict mode, add delete actions for unknown files
      LinkedHashSet<String> files = Utils.collectRelativePaths(toDir.toPath());
      for (PatchAction action : myActions) {
        files.remove(action.getPath());
      }
      for (String file : files) {
        myActions.add(0, new DeleteAction(this, file, Digester.INVALID));
      }
    }

    List<ValidationResult> results = new ArrayList<>();

    Set<String> deletedPaths = new HashSet<>(), deletedLinks = new HashSet<>();
    forEach(myActions, UpdaterUI.message("validating.installation"), ui, action -> {
      ValidationResult result = action.validate(toDir);

      if (action instanceof DeleteAction) {
        String path = mapPath(action.getPath());
        deletedPaths.add(path);
        if (Digester.isSymlink(action.getChecksum())) {
          deletedLinks.add(path);
        }
      }
      else if (result != null &&
               action instanceof CreateAction &&
               result.message.equals(UpdaterUI.message("file.exists")) &&
               toBeDeleted(mapPath(action.getPath()), deletedPaths, deletedLinks)) {
        result = null;  // do not warn about files going to be deleted
      }

      if (result != null) results.add(result);
    });

    return results;
  }
public List<ValidationResult> validate(File rootDir, UpdaterUI ui)