I'm writting this code for a project using GAE. Im not using Blobstore but i need to use the servingUrl method.
GcsFilename gcsFilename = new GcsFilename(myBucket, myFileName);
BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
BlobKey blobKey = blobstoreService.createGsBlobKey(
"/gs/" + gcsFilename.getBucketName() + "/" + gcsFilename.getObjectName());
ImagesService images = ImagesServiceFactory.getImagesService();
GcsFilename gcsFilename = new GcsFilename(myBucket, myFileName);
BlobstoreService blobstore = BlobstoreServiceFactory.getBlobstoreService();
BlobKey blobKey = blobstore.createGsBlobKey(key);
ServingUrlOptions opts = ServingUrlOptions.Builder.
withBlobKey(blobKey).
secureUrl(true);
images.getServingUrl(opts);
When I execute one of this codes, im getting this error:
Exception in thread "main" com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'blobstore' or call 'CreateEncodedGoogleStorageKey()' was not found.
Any idea?
@LaiaxanIV's solution posted as an edit to the question: