0

This is partly related to use within the testing (localhost, from Eclipse) environment. I am using GCS with com.google.cloud.storage.Storage. using JAVA in the server (and GWT in the client).

Ultimately, I want to have a URL of an image store as a com.google.cloud.storage.Blob passed from the server to GWT to be displayed with MaterialImage.

One problem when running under localhost (app engine) I noticed that the Blobs are being stored actually on the GCP in my Blob storage (meaning not locally/temporarily for testing on localhost.

This ultimately causes problems when trying to use,storage.signedUrl, for example: URL signedUrl = storage.signUrl(BlobInfo.newBuilder("bucket","filename").build(), 2, TimeUnit.DAYS); here I get the error '*Signing key was not provided and could not be derived'....

Ulitimately, I want/need a solution that works the same on localhost (for testing) and on the app engine in GCP (meaning, for example, I don't want to have a reference to my local key to solve the problem above).

Bottom line:

  1. Can I have temporarily stored cloud storage blobs on localhost? and how? I think might solve my issues...

  2. How can I generate a URL (not necessarily signed) that I can give to something like MaterialImage in the client. I don't necessarily want to transfer bytes to the client (though I will do this for text files).

Thanks for any help or hint... (once again JAVA solution)

1 Answer 1

0

You have the getServingUrl() method that allows returns the URL that serves the image. Using this method you can generate an URL for an image that is stored in Cloud Storage or Blobstore.

1
  • Yes, this returns a URL, but unfortunately it does not work inside MaterialImage (or I suppose image)... When this link is used the browser, for example, it goes directly to download object, the browser does not 'render' the object... I suspect this is why it doesn't work within Image. Commented Mar 13, 2018 at 9:32

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.