private static function createGsKey($filename) {
    if (!self::parseFilename($filename, $bucket, $object) || !$object) {
      throw new \InvalidArgumentException(
          sprintf('Invalid Google Cloud Storage filename: %s',
                  htmlspecialchars($filename)));
    }

    $gs_filename = sprintf('/gs/%s%s', $bucket, $object);

    $request = new CreateEncodedGoogleStorageKeyRequest();
    $response = new CreateEncodedGoogleStorageKeyResponse();

    $request->setFilename($gs_filename);

    try {
      ApiProxy::makeSyncCall('blobstore',
                             'CreateEncodedGoogleStorageKey',
                             $request,
                             $response);
    } catch (ApplicationError $e) {
      throw self::applicationErrorToException($e);
    }

    return $response->getBlobKey();
  }
private static function createGsKey($filename) {
    if (!self::parseFilename($filename, $bucket, $object) || !$object) {
      throw new \InvalidArgumentException(
          sprintf('Invalid Google Cloud Storage filename: %s',
                  htmlspecialchars($filename)));
    }

    $gs_filename = sprintf('/gs/%s%s', $bucket, $object);

    $request = new CreateEncodedGoogleStorageKeyRequest();
    $response = new CreateEncodedGoogleStorageKeyResponse();

    $request->setFilename($gs_filename);

    try {
      ApiProxy::makeSyncCall('blobstore',
                             'CreateEncodedGoogleStorageKey',
                             $request,
                             $response);
    } catch (ApplicationError $e) {
      throw self::applicationErrorToException($e);
    }

    return $response->getBlobKey();
  }
private static function createGsKey ( $ filename ) { if ( ! self :: parseFilename ( $ filename , $ bucket , $ object ) || ! $ object ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid Google Cloud Storage filename: %s' , htmlspecialchars ( $ filename ) ) ) ; } $ gs_filename = sprintf ( '/gs/%s%s' , $ bucket , $ object ) ; $ request = new CreateEncodedGoogleStorageKeyRequest ( ) ; $ response = new CreateEncodedGoogleStorageKeyResponse ( ) ; $ request -> setFilename ( $ gs_filename ) ; try { ApiProxy :: makeSyncCall ( 'blobstore' , 'CreateEncodedGoogleStorageKey' , $ request , $ response ) ; } catch ( ApplicationError $ e ) { throw self :: applicationErrorToException ( $ e ) ; } return $ response -> getBlobKey ( ) ; }
Create a blob key for a Google Cloud Storage file.

@param string $filename The google cloud storage filename, in the format
gs://bucket_name/object_name

@return string A blob key for this filename that can be used in other API
calls.

@throws \InvalidArgumentException if the filename is not in the correct
format.
@throws CloudStorageException If there was a problem contacting the
service.
@deprecated This method will be made private in the next version.

@access private
Create a blob key for a Google Cloud Storage file .