📅  最后修改于: 2022-03-11 14:52:19.110000             🧑  作者: Mango
String file_path = file.getPath();
InputStream file_input_stream = new FileInputStream(file_path);
BlobId blobId = BlobId.of(bucket, folder+"/"+blobName);
System.out.println("Blob Id:"+blobId);
BlobInfo blobInfo = BlobInfo
.newBuilder(blobId)
.setContentType("application/pdf")
.build();
Blob blob = storage.create(blobInfo, file_input_stream.readAllBytes());