I'm trying to use Google Cloud storage to store images that I'll be using in jsp files. I've created the bucket, uploaded an image (for testing purposes) and try to retrieve a Url to it from a java class. I keep getting the error message
HTTP ERROR 500
Problem accessing /. Reason:
INVALID_BLOB_KEY: Could not read blob.
Caused by:
java.lang.IllegalArgumentException: INVALID_BLOB_KEY: Could not read blob.
at
com.google.appengine.api.images.ImagesServiceImpl.getServingUrl(ImagesServiceImpl.java:282)
The Bucket I created
The code I use to retrieve the Url (BUCKETNAME is a static string with the name of the bucket)
public static String getImageURL(String inFilename) {
String key = "/gs/" + BUCKETNAME + "/" + inFilename;
ImagesService imagesService = ImagesServiceFactory.getImagesService();
ServingUrlOptions options = ServingUrlOptions.Builder.withGoogleStorageFileName(key);
String servingUrl = imagesService.getServingUrl(options);
return servingUrl;
}
I've tried to make the image public, but that didn't help. I've looked through various answers here, but I'm a bit lost. Any help would be appreciated
