def get_text_file(self, full_bucket_path):
"""Gets a text file object as a string.
Args:
full_bucket_path (str): The full path of the bucket object.
Returns:
str: The object's content as a string.
Raises:
HttpError: HttpError is raised if the call to the GCP storage API
fails
"""
bucket, object_name = get_bucket_and_path_from(full_bucket_path)
try:
return self.repository.objects.download(bucket, object_name)
except errors.HttpError as e:
LOGGER.error('Unable to download file: %s', e)
raise
评论列表
文章目录