def download_check_sum(self, checksum_type, origin_file_name): """ return pre calculated checksum value, only avaiable for remote repos """ checksum_url = origin_file_name + "." + checksum_type try: return download_string(checksum_url) except DownloadException: return None
def download_pom(self, artifact): if artifact in self.pom_not_found_cache: return None if artifact in self.pom_cache: return self.pom_cache[artifact] if artifact.is_snapshot(): snapshot_info = self.get_snapshot_info(artifact) if snapshot_info is not None: ts, bn = snapshot_info artifact.timestamp = ts artifact.build_number = bn maven_path = self.get_artifact_uri(artifact, 'pom') try: logger.info('[Checking] pom file %s' % maven_path) data = download_string(maven_path) # cache self.pom_cache[artifact] = data return data except DownloadException: self.pom_not_found_cache.append(artifact) logger.info('[Skipped] Pom file not found at %s' % maven_path) return None
def get_snapshot_info(self, artifact): metadata_path = self.get_metadata_path(artifact) try: data = download_string(metadata_path) eletree = ElementTree.fromstring(data) timestamp = eletree.findtext('versioning/snapshot/timestamp') build_number = eletree.findtext('versioning/snapshot/buildNumber') return timestamp, build_number except DownloadException: return None