private String createUniqueExportFileName(File priIdb, File secIdb, ESide side) {
    String priName = FileUtils.getFileBasename(priIdb);
    String secName = FileUtils.getFileBasename(secIdb);

    if (priName.equals(secName)) {
      priName = priName + "_primary";
      secName = secName + "_secondary";
    }

    priName =
        BinDiffFileUtils.forceFilenameEndsWithExtension(
            priName, Constants.BINDIFF_BINEXPORT_EXTENSION);
    secName =
        BinDiffFileUtils.forceFilenameEndsWithExtension(
            secName, Constants.BINDIFF_BINEXPORT_EXTENSION);

    return side == ESide.PRIMARY ? priName : secName;
  }
Directory diffing thread implementation that displays visual progress.
java/ui/src/main/java/com/google/security/zynamics/bindiff/gui/tabpanels/projecttabpanel/implementations/DirectoryDiffImplementation.java