2017-06-05 23 views
1

我更新了谷歌云依赖从0.4.00.18.0-alpha缺课在谷歌云:0.18.0-α

<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

使用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()