java.lang.Object
com.googlecode.download.maven.plugin.internal.checksum.Checksums

public final class Checksums extends Object
Checksums supplied to verify file integrity.
Author:
Paul Polishchuk
  • Constructor Details

    • Checksums

      public Checksums(@Nullable String md5, @Nullable String sha1, @Nullable String sha256, @Nullable String sha512, org.apache.maven.plugin.logging.Log log)
  • Method Details

    • isValid

      public boolean isValid(File file)
      Validates the file with supplied checksums.
      Parameters:
      file - File to validate.
      Returns:
      True if the file matches all supplied checksums or if no checksums were supplied.
    • validate

      public void validate(File file) throws Exception
      Validates the file with supplied checksums.
      Parameters:
      file - File to validate.
      Throws:
      Exception - If the file didn't match any supplied checksum.