1

I have been working on utility where I have written java maven and in which I want to upload the file to the firebase and get the firebase URL for image.

Right Now I am using gsutil: Google cloud storage SDK using below code

Storage storage = StorageOptions.getDefaultInstance()
         .getService();
 Bucket bucket = storage.get(bucketName);

 //... code required

return "gs://" + blobId.getBucket() + "/" + blobId.getName();

But above code is giving me gsutil URL which is not usable in HTML img src.

I want firebase URL which can be used in HTML img tag.

In shor I want download URL using Java-Spring code(not android).

Parth Lukhi
  • 181
  • 8

1 Answers1

0

The Firebase Admin SDK provides a fairly thin wrapper around the Google Cloud Storage SDK for Java. In Node.js this is accomplished by calling getSignedUrl(), but it seems on Java that you need getMediaLink() as shown in the Cloud Storage documentation.

Also see:

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807