I am trying to upload images to firebase storage and to save the download URL in my database. However, I cannot find a way to get the download Url in springboot unlike when an upload is performed in android. Saving the media URL does not work as it doesn't have the access token. Below is the code I've used to upload the image to firebase.
File file = convertMultiPartToFile(multipartFile);
Path filePath = file.toPath();
String objectName = generateFileName(multipartFile);
BlobId blobId = BlobId.of(bucketName, objectName);
BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build();
Blob blob = storage.create(blobInfo, Files.readAllBytes(filePath));
log.info("File " + filePath + " uploaded to bucket " + bucketName + " as " + objectName);
return blob.getMediaLink();