

def _end_creation(self, token):
    'End object upload.\n\n    Args:\n      token: upload token returned by post_start_creation.\n\n    Raises:\n      ValueError: if token is invalid. Or file is corrupted during upload.\n\n    Save file content to blobstore. Save blobinfo and _AE_GCSFileInfo.\n    '
    gcs_file = _AE_GCSFileInfo_.get_by_key_name(token)
    if (not gcs_file):
        raise ValueError('Invalid token')
    (error_msg, content) = self._get_content(gcs_file)
    if error_msg:
        raise ValueError(error_msg)
    gcs_file.etag = hashlib.md5(content).hexdigest()
    gcs_file.creation = datetime.datetime.utcnow()
    gcs_file.size = len(content)
    self.blob_storage.StoreBlob(token, StringIO.StringIO(content))
    gcs_file.finalized = True
    gcs_file.put()

dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/cloudstorage/cloudstorage_stub.py CloudStorageStub._end_creation/original