【发布时间】:2016-11-30 07:19:20
【问题描述】:
我需要使用来自 Google App Engine 的 Google Cloud Storage。因此,为此,我尝试使用应用程序默认凭据来获取授权凭据以连接到 Cloud Storage API。我使用添加 Google Api 选项在 Eclipse 中添加了 Google Cloud Storage JSON API。它添加了 google-api-client-1.18.0-rc.jar。这个jar没有下面的方法。
GoogleCredential credential = GoogleCredential.getApplicationDefault(transport, jsonFactory);
当我看到下面的示例时,我看到了依赖项
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-storagetransfer</artifactId>
<version>v1-rev1-1.20.0</version>
</dependency>
但在 Eclipse 中,使用添加 Google API 窗口时,我看不到找到此“v1-rev1-1.20.0”版本的 Google Cloud Storage API 的方法。如何下载与 v1-rev1-1.20.0 版本兼容的 Google Cloud Storage API jar?
【问题讨论】:
-
您不需要 GoogleCredential。你想做什么?
标签: java google-app-engine google-cloud-storage