how to send images to storage using admin sdk in java

Solutions on MaxInterview for how to send images to storage using admin sdk in java by the best coders in the world

showing results for - "how to send images to storage using admin sdk in java"
Fabio
20 Aug 2020
1String file_path = file.getPath();
2InputStream file_input_stream = new FileInputStream(file_path);
3
4BlobId blobId = BlobId.of(bucket, folder+"/"+blobName);
5System.out.println("Blob Id:"+blobId);
6BlobInfo blobInfo = BlobInfo
7            .newBuilder(blobId)
8            .setContentType("application/pdf")              
9            .build();
10Blob blob = storage.create(blobInfo, file_input_stream.readAllBytes());
11
similar questions