'Generate metadata for the upload.
Note: we don\'t set the etag, since the GCS API does not accept what we set'

def get_metadata(self):

    metadata = {'acl': [{'entity': 'allUsers', 'role': 'READER'}], 'md5Hash': base64.b64encode(self.payload_checksum.decode('hex')), 'contentType': self.content_type, 'cacheControl': unicode(self.cache_control)}
    if (self.content_encoding is not None):
        metadata['contentEncoding'] = self.content_encoding
    return metadata
