if (!filename.startsWith("/gs/")) {
throw new IllegalArgumentException("Google storage filenames must be" +
" prefixed with /gs/");
}
CreateEncodedGoogleStorageKeyRequest request = new CreateEncodedGoogleStorageKeyRequest();
request.setFilename(filename);
byte[] responseBytes;
try {
responseBytes = ApiProxy.makeSyncCall(PACKAGE,
"CreateEncodedGoogleStorageKey", request.toByteArray());
} catch (ApiProxy.ApplicationException ex) {
switch (BlobstoreServiceError.ErrorCode.valueOf(ex.getApplicationError())) {
case INTERNAL_ERROR:
throw new BlobstoreFailureException("An internal blobstore error occured.");
default: