private boolean isUpToDate()

in src/com/pty4j/util/ExtractedNative.java [166:184]


  private boolean isUpToDate(@NotNull Set<String> bundledResourceNames, @NotNull Map<String, Path> resourceToFileMap) {
    if (!bundledResourceNames.equals(resourceToFileMap.keySet())) {
      return false;
    }
    for (Map.Entry<String, Path> entry : resourceToFileMap.entrySet()) {
      try {
        URL bundledUrl = getBundledResourceUrl(entry.getKey());
        byte[] bundledContentChecksum = md5(bundledUrl.openStream());
        byte[] fileContentChecksum = md5(Files.newInputStream(entry.getValue()));
        if (!Arrays.equals(bundledContentChecksum, fileContentChecksum)) {
          return false;
        }
      } catch (Exception e) {
        LOG.error("Cannot compare md5 checksums", e);
        return false;
      }
    }
    return true;
  }