2017-06-05 24 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()