private static void checkSha256ChecksumValid(@NotNull CompileContext context,
                                               @NotNull JpsMavenRepositoryLibraryDescriptor descriptor,
                                               @NotNull String libraryName,
                                               @NotNull JpsMavenRepositoryLibraryDescriptor.ArtifactVerification verification)
    throws ArtifactVerificationException {
    Path path = JpsPathUtil.urlToFile(verification.getUrl()).toPath();

    String actualSha256Sum;
    try {
      actualSha256Sum = JpsChecksumUtil.getSha256Checksum(path);
    }
    catch (IOException e) {
      context.processMessage(CompilerMessage.createInternalBuilderError(getBuilderName(), e));
      throw new RuntimeException(e);
    }
    String expectedSha256Sum = verification.getSha256sum();

    if (!Objects.equals(expectedSha256Sum, actualSha256Sum)) {
      reportInvalidArtifactChecksum(context, libraryName, descriptor, path, actualSha256Sum);
      throw new ArtifactVerificationException(
        JpsBuildBundle.message("build.message.error.invalid.sha256.checksum", libraryName, path, expectedSha256Sum, actualSha256Sum)
      );
    }
  }
private static void checkSha256ChecksumValid(@NotNull CompileContext context,
                                               @NotNull JpsMavenRepositoryLibraryDescriptor descriptor,
                                               @NotNull String libraryName,
                                               @NotNull JpsMavenRepositoryLibraryDescriptor.ArtifactVerification verification)