我试图上传我的客户的文件从springboot应用程序部署在gcp计算引擎到googlebucket。下面的代码将该文件上载到bucket中,但出现错误:
Resource resource = resourceLoader.getResource(GCP_AUTHENTICATION_FILE);
InputStream dbAsStream = resource.getInputStream();
String bucketName = GCP_BUCKET_NAME;
Storage storage = StorageOptions.newBuilder().setCredentials(GoogleCredentials.fromStream(dbAsStream))
.setProjectId(GCP_PROJECT_ID).build().getService();
BlobId blobId = BlobId.of(bucketName, fileName);
BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build();
storage.create(blobInfo, ClientFile.getBytes());
错误:
Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: 'com.google.api.client.util.DateTime com.google.api.services.storage.model.StorageObject.getCustomTime()'
暂无答案!
目前还没有任何答案,快来回答吧!