谷歌云中缺少类:0.18.0-alpha

时间:2017-06-05 14:00:59

标签: google-cloud-platform

我将google-cloud依赖关系从0.4.0更新为0.18.0-alpha

    <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud</artifactId>
        <version>0.18.0-alpha</version>
    </dependency>

版本更新后,下面的课程已经消失。

com.google.cloud.AuthCredentials
com.google.cloud.Page

我应该用哪些类替换它们?

1 个答案:

答案 0 :(得分:1)

使用com.google.api.gax.paging.Page代替com.google.cloud.Page

使用com.google.auth.oauth2.ServiceAccountCredentials代替com.google.cloud.AuthCredentials

AuthCredentials.ServiceAccountAuthCredentials类被删除(请参阅https://github.com/GoogleCloudPlatform/google-cloud-java/pull/1375)。

旧用法

AuthCredentials.ServiceAccountAuthCredentials serviceAccountAuthCredentials = AuthCredentials
            .ServiceAccountAuthCredentials.createForJson(new FileInputStream(CREDENTIALS_FILE));

新用法

ServiceAccountCredentials serviceAccountAuthCredentials = ServiceAccountCredentials.fromStream(new FileInputStream(CREDENTIALS_FILE));

https://github.com/GoogleCloudPlatform/google-cloud-java/pull/1947

某些方法已重命名

  • builder()方法重命名为newBuilder()
  • getter / setter方法重命名为Java Bean命名标准。例如,BlobId.bucket()已重命名为BlobId.getBucket()