class KPM::BaseArtifact

def pull_and_verify(logger, remote_sha1, coordinates, destination_dir, sha1_file, verify_sha1, overrides={}, ssl_verify=true)

def pull_and_verify(logger, remote_sha1, coordinates, destination_dir, sha1_file, verify_sha1, overrides={}, ssl_verify=true)
  info = nexus_remote(overrides, ssl_verify).pull_artifact(coordinates, destination_dir)
  # Always verify sha1 and if incorrect either throw or log when we are asked to bypass sha1 verification
  verified = verify(logger, coordinates, info[:file_path], remote_sha1)
  if !verified
    raise ArtifactCorruptedException if verify_sha1
    logger.warn("Skip sha1 verification for  #{coordinates}")
  end
  if sha1_file
    sha1_checker = Sha1Checker.from_file(sha1_file)
    sha1_checker.add_or_modify_entry!(coordinates, remote_sha1)
  end
  info
end