public static String forceFilenameEndsNotWithExtension(
      final String filename, final String extension) {
    String value = filename;
    if (value.toLowerCase().endsWith(("." + extension).toLowerCase())) {
      value = filename.substring(0, filename.length() - ("." + extension).length());
    }

    return value;
  }
BinDiff-specific file name and filesystem utility methods.
java/ui/src/main/java/com/google/security/zynamics/bindiff/utils/BinDiffFileUtils.java