@Override
  protected void runExpensiveCommand() throws Exception {
    List<String> matchesPaths = directoryDiff();
    if (!matchesPaths.isEmpty()) {
      setGeneralDescription("Preloading diffs...");
    }

    for (String path : matchesPaths) {
      if (path == null) {
        continue;
      }
      var newMatchesDatabase = new File(path);

      try {
        setDescription(String.format("Loading '%s'", newMatchesDatabase.getName()));

        if (newMatchesDatabase.exists()) {
          DiffMetadata preloadedMatches = DiffLoader.preloadDiffMatches(newMatchesDatabase);

          workspace.addDiff(newMatchesDatabase, preloadedMatches, false);
        }
      } catch (Exception e) {
        var msg =
            String.format("Could not load '%s' into workspace.", newMatchesDatabase.getName());
        openingDiffErrorMessages.add(msg);
      }
    }
  }
Directory diffing thread implementation that displays visual progress.
java/ui/src/main/java/com/google/security/zynamics/bindiff/gui/tabpanels/projecttabpanel/implementations/DirectoryDiffImplementation.java