#NEWLINE# def _copy2( src , dst , metadata = None , retry_params = None ) : #NEWLINE# #INDENT# "Copy the file content from src to dst.\n\n  Internal use only!\n\n  Args:\n    src: /bucket/filename\n    dst: /bucket/filename\n    metadata: a dict of metadata for this copy. If None, old metadata is copied.\n      For example, {'x-goog-meta-foo': 'bar'}.\n    retry_params: An api_utils.RetryParams for this call to GCS. If None,\n      the default one is used.\n\n  Raises:\n    errors.AuthorizationError: if authorization failed.\n    errors.NotFoundError: if an object that's expected to exist doesn't.\n  " #NEWLINE# common . validate_file_path ( src ) #NEWLINE# common . validate_file_path ( dst ) #NEWLINE# if ( metadata is None ) : #NEWLINE# #INDENT# metadata = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# copy_meta = 'COPY' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# copy_meta = 'REPLACE' #NEWLINE# #UNINDENT# metadata . update ( { #NEWLINE# #INDENT# 'x-goog-copy-source' : src , #NEWLINE# 'x-goog-metadata-directive' : copy_meta , #NEWLINE# #UNINDENT# } ) #NEWLINE# api = storage_api . _get_storage_api ( retry_params = src ) #NEWLINE# ( status , resp_headers , content ) = api . put_object ( api_utils . _quote_filename ( dst ) , headers = metadata ) #NEWLINE# errors . check_status ( status , [ 200 ] , src , metadata , resp_headers , body = content )