[英]public GC storage access fails with Anonymous caller does not have storage.objects.get access
I'm trying to access Sentinel2 public data as described here: https://cloud.google.com/storage/docs/public-datasets我正在尝试按照此处所述访问 Sentinel2 公共数据: https://cloud.google.com/storage/docs/public-datasets
That document says: "By contrast, accessing public data with a Cloud Storage API link does not require authentication."该文件说:“相比之下,使用 Cloud Storage API 链接访问公共数据不需要身份验证。”
However I'm getting the following error: "com.google.cloud.storage.StorageException: Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object."但是我收到以下错误:“com.google.cloud.storage.StorageException:匿名调用者没有 storage.objects.get 访问 Google Cloud Storage object。” I'm using Java API:
我正在使用 Java API:
storage = StorageOptions.getDefaultInstance().getService()存储 = StorageOptions.getDefaultInstance().getService()
blob = storage.get(BlobId.of("bucketName", "objectName")) blob = storage.get(BlobId.of("bucketName", "objectName"))
Does anyone know how to download those files using Java API?有谁知道如何使用 Java API 下载这些文件? Thanks!
谢谢!
The object needs to be publicly readable in order to access it anonymously, and that error indicates the object you're trying to read is not publicly readable. object 需要公开可读才能匿名访问,该错误表明您尝试阅读的 object 不可公开阅读。
The Sentinel-2 bucket, gcp-public-data-sentinel-2
, does not allow unauthenticated, anonymous listing (although you should be able to browse it while logged in as any account). Sentinel-2 存储桶
gcp-public-data-sentinel-2
不允许未经身份验证的匿名列表(尽管您应该能够在以任何帐户登录时浏览它)。 Instead, the object index.csv.gz
inside the bucket contains a listing of the contents which you may access.相反,存储桶内的 object
index.csv.gz
包含您可以访问的内容列表。 Individual objects can be downloaded anonymously and have a fairly lengthy file path, for example:单个对象可以匿名下载并具有相当长的文件路径,例如:
https://storage.googleapis.com/gcp-public-data-sentinel-2/tiles/04/E/CR/S2B_MSIL1C_20190301T202209_N0207_R042_T04ECR_20190301T212521.SAFE/GRANULE/L1C_T04ECR_A010364_20190301T202210/IMG_DATA/T04ECR_20190301T202209_B01.jp2 https://storage.googleapis.com/gcp-public-data-sentinel-2/tiles/04/E/CR/S2B_MSIL1C_20190301T202209_N0207_R042_T04ECR_20190301T212521.SAFE/GRANULE/L1C_T04ECR_A010364_20190301T202210/IMG_DATA/T04ECR_20190301T202209_B01.jp2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.