o ckF[O£ã@sxddlZddlZddlZddlZddlmZddlmZddlmZGdd„de ƒZ Gdd„de ƒZ Gd d „d e ƒZ dS) éN)Ú DeleteMarker©ÚBotoClientError)ÚInvalidUriErrorc@säeZdZdZdZdZiZdd„Zdd„Zdd„Z d d „Z d d „Z d d„Z dd„Z d.dd„Zdd„Z  d/dd„Z  d0dd„Zd1dd„Zd2dd„Zd1dd „Zd2d!d"„Zd.d#d$„Z %   d3d&d'„Z  d4d(d)„Zd*d+„Zd,d-„ZdS)5Ú StorageUrizæ Base class for representing storage provider-independent bucket and object name with a shorthand URI-like syntax. This is an abstract class: the constructor cannot be called (throws an exception if you try). NcCstdƒ‚)zBUncallable constructor on abstract base StorageUri class. z0Attempt to instantiate abstract StorageUri classr©Úself©r ú2/usr/lib/python3/dist-packages/boto/storage_uri.pyÚ__init__6szStorageUri.__init__cCs|jS)z%Returns string representation of URI.©Úurirr r r Ú__repr__<szStorageUri.__repr__cCs |j|jkS)z#Returns true if two URIs are equal.r )rr r r r Úequals@ó zStorageUri.equalscCs*|durtd t d||fd¡¡ƒ‚dS)NÚ zÉAttempt to get %s for "%s" failed. This can happen if the URI refers to a non-existent object or if you meant to operate on a directory (e.g., leaving off -R option on gsutil cp, mv, or ls of a bucket)éP)rÚjoinÚtextwrapÚwrap)rÚrespÚlevelr r r r Úcheck_responseDs ýüÿzStorageUri.check_responsecCó.tt|ƒtƒr|jstd||jfƒ‚dSdS)Nz%s on bucket-less URI (%s))Ú issubclassÚtypeÚBucketStorageUriÚ bucket_namerr ©rÚ function_namer r r Ú_check_bucket_uriLs  ÿÿzStorageUri._check_bucket_uricCr)Nz%s on object-less URI (%s))rrrÚ object_namerr rr r r Ú_check_object_uriQs ÿÿzStorageUri._check_object_uric Ks4|D]}||rtj d||t||ƒf¡qdS)Nz$Warning: %s ignores argument: %s=%s )ÚsysÚstderrÚwriteÚstr)rrÚargsÚargr r r Ú_warn_about_argsVsÿÿ€þzStorageUri._warn_about_argsc Ks t|jpdƒ}t|dƒrd|vr|j|d<| |¡|jsˆ|j|jvr+|j|j|_n]|jdkrHddlm }|||fi|¤Ž|_|j|j|j<n@|jdkrpddl m }ddlm }|ƒ|d <|||fi|¤Ž|_|j|j|j<n|jd krdd l m}||ƒ|_ntd |jƒ‚|j|j_|jS) aË Opens a connection to appropriate provider, depending on provider portion of URI. Requires Credentials defined in boto config file (see boto/pyami/config.py). @type storage_uri: StorageUri @param storage_uri: StorageUri specifying a bucket or a bucket+object @rtype: L{AWSAuthConnection} @return: A connection to storage service provider of the given URI. r Úsuppress_consec_slashesÚs3r)Ú S3ConnectionÚgs)Ú GSConnection)ÚOrdinaryCallingFormatÚcalling_formatÚfile)ÚFileConnectionzUnrecognized scheme "%s")ÚdictÚconnection_argsÚhasattrr*ÚupdateÚ connectionÚschemeÚ provider_poolÚboto.s3.connectionr,Úboto.gs.connectionr.r/Úboto.file.connectionr2rÚdebug) rÚ access_key_idÚsecret_access_keyÚkwargsr4r,r.r/r2r r r Úconnect]sF ÿ    ÿþ    ÿþ   ÿ zStorageUri.connectcCs"tt|ƒtƒo|jdup|jduS©N)rrrÚ version_idÚ generationrr r r Ú has_version—s þzStorageUri.has_versionFcCs(| d¡| ||¡}| |j|||¡S)NÚ delete_key)r"Ú get_bucketrFr!©rÚvalidateÚheadersrCÚ mfa_tokenÚbucketr r r rFœó   ÿzStorageUri.delete_keyÚcCsD| d¡|j|d}|rdd„|j|||dDƒS|j|||dS)NÚ list_bucket©rJcss|] }t|tƒs|VqdSrB)Ú isinstancer)Ú.0Úvr r r Ú ¨s€þz)StorageUri.list_bucket..)ÚprefixÚ delimiterrJ)r rGÚ list_versionsÚlist)rrUrVrJÚ all_versionsrLr r r rO£s    ÿÿzStorageUri.list_bucketcCs| ||¡}| |¡SrB)rGÚ get_all_keys)rrIrJrUrLr r r rZ¯s  zStorageUri.get_all_keyscCs6| d¡| ¡}| |j||¡}| |d|j¡|S)NrGrL)r rArGrrr )rrIrJÚconnrLr r r rG³s zStorageUri.get_bucketcCs:| d¡| ||¡}| |j||¡}| |d|j¡|S)NÚget_keyÚkey)r"rGr\r!rr ©rrIrJrCrLr]r r r r\ºs  zStorageUri.get_keycCs"| d¡| ||¡}| |j¡S)NÚnew_key)r"rGr_r!©rrIrJrLr r r r_Áó   zStorageUri.new_keycCsD| d¡|jddd| d|¡}| |d|j¡|j|||dS)Nr\F)rIr]©rC)r"r)r\rr Úget_contents_to_file)rÚfprJrCr]r r r Úget_contents_to_streamÆs  z!StorageUri.get_contents_to_streamé c Csf| d¡| d|¡} | | d|j¡| r%| j||||||||| d dS|  ||||||||¡dS)Nrcr])Ú hash_algs)r"r\rr rc) rrdrJÚcbÚnum_cbÚtorrentrCÚres_download_handlerÚresponse_headersrgr]r r r rcÍs   ýþzStorageUri.get_contents_to_filecCs8| d¡| ||¡}| |d|j¡| |||||¡S)NÚget_contents_as_stringr])r"r\rr rm)rrIrJrhrirjrCr]r r r rmÞs   ÿz!StorageUri.get_contents_as_stringcCó$| ¡}|jj}| |d|j¡|S)NÚ acl_class)rAÚproviderrorr )rr[ror r r roæózStorageUri.acl_classcCrn)NÚ canned_acls)rArprrrr )rr[rrr r r rrìrqzStorageUri.canned_acls©NN©FNNN)rNrNNF©FNN©FN)NNrfFNNNN)FNNrfFN)Ú__name__Ú __module__Ú __qualname__Ú__doc__r7r4r9r rrrr r"r)rArErFrOrZrGr\r_rercrmrorrr r r r r sF : ÿ ÿ     ý ÿ rc@sÂeZdZdZdZegƒZ   d„dd„Zd d „Zd d „Z d d„Z d…dd„Z  d†dd„Z dd„Z dd„Zd…dd„Zd‡dd„Zd‡dd„Zd‡dd„Zd‡dd „Zd‡d!d"„Zd‡d#d$„Z  d…d%d&„Z  dˆd'd(„Z  dˆd)d*„Z  dˆd+d,„Zd‰d-d.„Zd/d0„Zd1d2„Zd3d4„Zd5d6„Zd7d8„Zd9d:„Z d;d<„Z!d=d>„Z"d?d@„Z#dAdB„Z$  dŠdDdE„Z%d‰dFdG„Z&d‰dHdI„Z'dJdK„Z(  d‹dLdM„Z)  d‹dNdO„Z*d‡dPdQ„Z+  d…dRdS„Z,  d…dTdU„Z-  d…dVdW„Z.  d…dXdY„Z/   dŒd[d\„Z0   dd]d^„Z1  dŽd_d`„Z2  a  ddbdc„Z3  dddde„Z4d…dfdg„Z5d…dhdi„Z6  d‘djdk„Z7d‡dldm„Z8d‰dndo„Z9d‰dpdq„Z: d‰drds„Z;d’dtdu„Zd‰dzd{„Z?  dˆd|d}„Z@d‡d~d„ZA  d“d€d„ZBd‰d‚dƒ„ZCdS)”rz StorageUri subclass that handles bucket storage providers. Callers should instantiate this class by calling boto.storage_uri(). ú/NrTFc Csb||_||_||_||_|r||_||_||_|ot|ƒ|_| |_ t |jƒp)t |ƒ|_ |  ¡dS)aÐInstantiate a BucketStorageUri from scheme,bucket,object tuple. @type scheme: string @param scheme: URI scheme naming the storage provider (gs, s3, etc.) @type bucket_name: string @param bucket_name: bucket name @type object_name: string @param object_name: object name, excluding generation/version. @type debug: int @param debug: debug level to pass in to connection (range 0..2) @type connection_args: map @param connection_args: optional map containing args to be passed to {S3,GS}Connection constructor (e.g., to override https_connection_factory). @param suppress_consec_slashes: If provided, controls whether consecutive slashes will be suppressed in key paths. @param version_id: Object version id (S3-specific). @param generation: Object generation number (GCS-specific). @param is_latest: boolean indicating that a versioned object is the current version After instantiation the components are available in the following fields: scheme, bucket_name, object_name, version_id, generation, is_latest, versionless_uri, version_specific_uri, uri. Note: If instantiated without version info, the string representation for a URI stays versionless; similarly, if instantiated with version info, the string representation for a URI stays version-specific. If you call one of the uri.set_contents_from_xyz() methods, a specific object version will be created, and its version-specific URI string can be retrieved from version_specific_uri even if the URI was instantiated without version info. N) r8rr!r=r4r*rCÚintrDÚ is_latestÚboolÚis_version_specificÚ_build_uri_strings) rr8rr!r=r4r*rCrDr}r r r r üs$ zBucketStorageUri.__init__cCsž|jr9|jr9d|j|j|jf|_|jrd|j|jf|_n |jr*d|j|jf|_|jr3|j|_dS|j|_dS|jrGd|j|jf|_dSd|j|_dS)Nz %s://%s/%sz%s#%sz%s://%s/z%s://) rr!r8Úversionless_urirDÚversion_specific_urirCrr rr r r r€-s$  ÿ ÿÿ  z#BucketStorageUri._build_uri_stringsc Cs4| t|ddƒt|ddƒt|ddƒt|ddƒ¡dS)NrCrDr}Úmd5)Ú_update_from_valuesÚgetattr)rr]r r r Ú_update_from_key@s     üz!BucketStorageUri._update_from_keycCs$||_||_||_| ¡||_dSrB)rCrDr}r€rƒ)rrCrDr}rƒr r r r„Gs  z$BucketStorageUri._update_from_valuescCst| d¡| ||¡}| ¡jdkr|j|j||p|jd}n| ¡jdkr0|j|j||jd}| |d|j ¡|S)Nr\ÚawsrbÚgoogle©rDr]) r"rGÚ get_providerÚnamer\r!rCrDrr r^r r r r\Ns   ÿ ÿzBucketStorageUri.get_keycCsf| d¡| ||¡}| ¡jdkr |p|j}| |j|||¡S| ¡jdkr1|j|j||jdSdS)NrFr‡rˆr‰)r"rGrŠr‹rCrFr!rDrHr r r rFZs    ÿ ÿÿzBucketStorageUri.delete_keycCs$| d¡t|j|j||j|jdS)zºInstantiate a BucketStorageUri from the current BucketStorageUri, but replacing the object_name. @type new_name: string @param new_name: new object name Úclone_replace_name)rr!r=r*)r rr8rr=r*©rÚnew_namer r r rŒfs  ýz#BucketStorageUri.clone_replace_namec Csn| d¡d}d}d}t|dƒr|j}t|dƒr|j}t|dƒr#|j}t|j ¡|jj |j |j |j |||dS)a)Instantiate a BucketStorageUri from the current BucketStorageUri, by replacing the object name with the object name and other metadata found in the given Key object (including generation). @type key: Key @param key: key for the new StorageUri to represent Úclone_replace_keyNFrCrDr})rr!r=r*rCrDr}) r r5rCrDr}rrpÚget_provider_namerLr‹r=r*)rr]rCrDr}r r r rss(    øz"BucketStorageUri.clone_replace_keycCsn| d¡| ||¡}|jpd}| ¡jdkr$|p|j}| |||¡}n |j|||jd}| |d|j ¡|S)zreturns a bucket's aclÚget_aclrNr‡r‰Úacl) r rGr!rŠr‹rCr‘rDrr )rrIrJrCrLÚkey_namer’r r r r‘s    zBucketStorageUri.get_aclcCó4| d¡| ||¡}| |¡}| |d|j¡|S)z%returns a bucket's default object aclÚ get_def_aclr’)r rGr•rr )rrIrJrLr’r r r r•Ÿó   zBucketStorageUri.get_def_aclcCr”)zreturns a bucket's CORS XMLÚget_corsÚcors)r rGr—rr )rrIrJrLr˜r r r r—§r–zBucketStorageUri.get_corscCsD| d¡| ||¡}|jdkr| ||¡dS| | ¡|¡dS)z#sets or updates a bucket's CORS XMLz set_cors r+N)r rGr8Úset_corsÚto_xml)rr˜rIrJrLr r r r™¯s   zBucketStorageUri.set_corscCó | d¡| ||¡}| |¡S)NÚ get_location)r rGrœr`r r r rœ¸ó   zBucketStorageUri.get_locationcCs8| d¡|jdkrtd|jƒ‚| ||¡}| |¡S)NÚget_storage_classr-z.get_storage_class() not supported for %s URIs.)r r8Ú ValueErrorrGržr`r r r rž½s  ÿ  z"BucketStorageUri.get_storage_classcCs>| d¡|jdkrtd|jƒ‚| ||¡}| ||¡dS)z!Updates a bucket's storage class.Úset_storage_classr-z.set_storage_class() not supported for %s URIs.N)r r8rŸrGr )rÚ storage_classrIrJrLr r r r Çs  ÿ z"BucketStorageUri.set_storage_classcCs(| d¡| ||¡}| ||j||¡S)NÚget_subresource)r rGr¢r!)rÚ subresourcerIrJrCrLr r r r¢ÒrMz BucketStorageUri.get_subresourcecCs–| d¡|jdkrtd|jƒ‚|jr1|rtdƒ‚| ||¡}| |d|j¡| |||¡dS|jrD|  ||¡}| ||||¡dSt d|jƒ‚)NÚadd_group_email_grantr-z2add_group_email_grant() not supported for %s URIs.zDadd_group_email_grant() on key-ful URI cannot specify recursive=Truer]z-add_group_email_grant() on bucket-less URI %s) r r8rŸr!r\rr r¤rrGr)rÚ permissionÚ email_addressÚ recursiverIrJr]rLr r r r¤Ùs&  ÿ   ÿÿz&BucketStorageUri.add_group_email_grantcCó\| d¡|js| ||¡}| ||||¡dS| ||¡}| |d|j¡| ||¡dS)NÚadd_email_grantr])r r!rGr©r\rr )rr¥r¦r§rIrJrLr]r r r r©îs   ÿ z BucketStorageUri.add_email_grantcCr¨)NÚadd_user_grantr])r r!rGrªr\rr )rr¥Úuser_idr§rIrJrLr]r r r rªús   zBucketStorageUri.add_user_grantcCs| d¡| |¡}| |¡S)Nz list_grants )r rGÚ list_grants©rrJrLr r r r¬s   zBucketStorageUri.list_grantscCódS)ú3Returns True if this URI names a file or directory.Fr rr r r Ú is_file_uri ózBucketStorageUri.is_file_uricCr®)ú2Returns True if this URI names a bucket or object.Tr rr r r Ú is_cloud_urir±zBucketStorageUri.is_cloud_uricCó t|j ƒS)zÒ Returns True if this URI names a directory or bucket. Will return False for bucket subdirs; providing bucket subdir semantics needs to be done by the caller (like gsutil does). ©r~r!rr r r Únames_containers z BucketStorageUri.names_containercCó t|jƒS)z0Returns True if this URI names a file or object.rµrr r r Únames_singletonó z BucketStorageUri.names_singletoncCr®©z+Returns True if this URI names a directory.Fr rr r r Únames_directoryr±z BucketStorageUri.names_directorycCr´)ú*Returns True if this URI names a provider.)r~rrr r r Únames_provider"rzBucketStorageUri.names_providercCst|jƒo t|j ƒS)ú(Returns True if this URI names a bucket.)r~rr!rr r r Ú names_bucket&szBucketStorageUri.names_bucketcCr®)ú&Returns True if this URI names a file.Fr rr r r Ú names_file*r±zBucketStorageUri.names_filecCó| ¡S)ú)Returns True if this URI names an object.©r¸rr r r Ú names_object.ózBucketStorageUri.names_objectcCr®)z8Returns True if this URI represents input/output stream.Fr rr r r Ú is_stream2r±zBucketStorageUri.is_streamrNcCsB| d¡| ¡}|jdkr| |j||||¡S| |j|||¡S)Nzcreate_bucket r-)r rAr8Ú create_bucketr)rrJÚlocationÚpolicyr¡r[r r r rÈ6s  ÿzBucketStorageUri.create_bucketcCs | d¡| ¡}| |j|¡S)NÚ delete_bucket)r rArËr©rrJr[r r r rËBs zBucketStorageUri.delete_bucketcCs| ¡}| |¡SrB)rAÚget_all_bucketsrÌr r r rÍGs z BucketStorageUri.get_all_bucketscCs"| ¡}|j}| |d|j¡|S)Nrp)rArprr )rr[rpr r r rŠKszBucketStorageUri.get_providerc Csd| d¡|p |jp d}| ||¡}|jr#|j||||j||ddS|p'|j}| ||||¡dS)zSets or updates a bucket's ACL.Úset_aclrN©rDÚ if_generationÚif_metagenerationN)r r!rGrDrÎrC) rÚ acl_or_strr“rIrJrCrÐrÑrLr r r rÎQs    þ zBucketStorageUri.set_aclc Csf| d¡|p |jp d}| ||¡}|jr#|j||||j||ddS|p'|j}|j||||ddS)z2Sets or updates a bucket's ACL with an XML string.Ú set_xml_aclrNrÏrbN)r r!rGrDrÓrC) rÚ xmlstringr“rIrJrCrÐrÑrLr r r rÓ_s    þ   ÿzBucketStorageUri.set_xml_aclcCó"| d¡| ||¡ ||¡dS)zASets or updates a bucket's default object ACL with an XML string.Úset_def_xml_aclN)r rGrÖ)rrÔrIrJr r r rÖns z BucketStorageUri.set_def_xml_aclcCrÕ)z.Sets or updates a bucket's default object ACL.Ú set_def_aclN)r rGr×)rrÒrIrJrCr r r r×ss zBucketStorageUri.set_def_aclcCsD| d¡|jd|d| ||¡}| |d|j¡| ||¡dS)z>Sets or updates a bucket's acl to a predefined (canned) value.Úset_canned_aclrbr]N)r"r)r\rr rØ©rÚacl_strrIrJrCr]r r r rØys  zBucketStorageUri.set_canned_aclcCs8| d¡| ||¡}| |d|j¡| |||¡dS)zXSets or updates a bucket's default object acl to a predefined (canned) value.zset_def_canned_acl r]N)r r\rr Úset_def_canned_aclrÙr r r rÛ‚s  z#BucketStorageUri.set_def_canned_aclcCs.| d¡| ||¡}| |||j||¡dS)NÚset_subresource)r rGrÜr!)rr£ÚvaluerIrJrCrLr r r rÜ‹s  ÿz BucketStorageUri.set_subresourcerfc Csn| d¡|j|d} |jdkr$|rtj d¡|  |||||||¡} n |  ||||||||¡} | | ¡| S)NÚset_contents_from_stringrPr-z^Warning: GCS does not support reduced_redundancy; argument ignored by set_contents_from_string)r"r_r8r#r$r%rÞr†) rÚsrJÚreplacerhrirÊrƒÚreduced_redundancyr]Úresultr r r rÞ’s    ÿþ z)BucketStorageUri.set_contents_from_stringc CsŽ| d¡|j|d} |jdkr+| j||||||||| | d } | r*| d| jd|¡n|jd| d| j||||||||| d } | | ¡| S)NÚset_contents_from_filerPr-)ÚsizeÚrewindÚres_upload_handler)ræ)rärå)r"r_r8rãr„rDr)r†) rrdrJràrhrirÊrƒrärårær]râr r r rã¥s*   þ ÿ€ÿþ z'BucketStorageUri.set_contents_from_filec Cs:| d¡| d|¡}|j||||||d}| |¡|S)NÚset_contents_from_streamF)rÊrá)r"r_rçr†) rrdrJràrhrÊráÚdst_keyrâr r r rçºs   þ z)BucketStorageUri.set_contents_from_streamÚSTANDARDc Cs\| d¡|jd|d} | r| j|j|||||||| | d S| j|j||||||||| d S)zReturns newly created key.Úcopy_keyF)rIrJ) Ú new_key_nameÚsrc_bucket_nameÚ src_key_nameÚmetadatar¡Ú preserve_aclÚ encrypt_keyrJÚ query_argsÚsrc_generation) rërìrírîÚsrc_version_idr¡rïrðrJrñ)r"rGrêr!) rrìrírîrór¡rïrðrJrñròÚ dst_bucketr r r rêÄs$ úûzBucketStorageUri.copy_keycCs*| d¡| ||¡}|j|||ddS)NÚenable_loggingrP)r rGrõ)rÚ target_bucketÚ target_prefixrIrJrCrLr r r rõÛs  zBucketStorageUri.enable_loggingcCs&| d¡| ||¡}|j|ddS)NÚdisable_loggingrP)r rGrø©rrIrJrCrLr r r røás  z BucketStorageUri.disable_loggingcCs"| d¡| ||¡}|j|dS)NÚget_logging_configrP)r rGrúrùr r r rúæraz#BucketStorageUri.get_logging_configcCs>| d¡| ||¡}|s|s| |¡dS| |||¡dS)NÚset_website_config)r rGÚdelete_website_configurationÚconfigure_website)rÚmain_page_suffixÚ error_keyrIrJrLr r r rûës  z#BucketStorageUri.set_website_configcCr›)NÚget_website_config)r rGÚget_website_configurationr`r r r rôrz#BucketStorageUri.get_website_configcCs | d¡| d|¡}| |¡S)NÚget_versioning_configF)r rGÚget_versioning_statusr­r r r rùrz&BucketStorageUri.get_versioning_configcCs"| d¡| d|¡}| ||¡S)NÚconfigure_versioningF)r rGr)rÚenabledrJrLr r r rþraz%BucketStorageUri.configure_versioningcCs| d¡j||||dS)NFrP)r\Úset_remote_metadata)rÚ metadata_plusÚmetadata_minusrïrJr r r Ú set_metadatas ýzBucketStorageUri.set_metadatacCsT| d¡g}|D]}| | ¡¡|j|d_q | ¡j|||d|_| ¡|S)NÚcomposeéÿÿÿÿ)Ú content_typerJ)r"Úappendr_rDr r€)rÚ componentsr rJÚcomponent_keysÚsurir r r r  s ÿzBucketStorageUri.composecCr”)z+Returns a bucket's lifecycle configuration.Úget_lifecycle_configÚ lifecycle)r rGrrr )rrIrJrLÚlifecycle_configr r r rr–z%BucketStorageUri.get_lifecycle_configcCs&| d¡| ||¡}| ||¡dS)z3Sets or updates a bucket's lifecycle configuration.Úconfigure_lifecycleN)r rGr)rrrIrJrLr r r rs  z$BucketStorageUri.configure_lifecyclecCs8| d¡|jdkrtd|jƒ‚| d|¡}| |¡S)NÚget_billing_configr-z/get_billing_config() not supported for %s URIs.F)r r8rŸrGrr­r r r r$s  ÿ  z#BucketStorageUri.get_billing_configcCs@| d¡|jdkrtd|jƒ‚| ||¡}|j||ddS)z1Sets or updates a bucket's billing configuration.Úconfigure_billingr-z.configure_billing() not supported for %s URIs.)Úrequester_paysrJN)r r8rŸrGr)rrrIrJrLr r r r-s  ÿ z"BucketStorageUri.configure_billingcCs:| d¡|jdkrtd|jƒ‚| ||¡}|j|dS)z0Returns a GCS bucket's encryption configuration.Úget_encryption_configr-z2get_encryption_config() not supported for %s URIs.rP)r r8rŸrGrr`r r r r8s  ÿ  z&BucketStorageUri.get_encryption_configcCs(| d¡| ||¡}|j||ddS)z-Sets a GCS bucket's encryption configuration.Úset_encryption_config)Údefault_kms_key_namerJN)r rGr)rrrIrJrLr r r rCs   ÿz&BucketStorageUri.set_encryption_configcCs6|js td|jƒ‚| |¡}|j|j|d}t|ƒS)z8Returns True if the object exists or False if it doesn'tzexists on object-less URI (%s)rP)r!rr rGr\r~)rrJrLr]r r r ÚexistsKs  zBucketStorageUri.exists)NNrNTNNFrurtrv)FFNrB)NrNNN)rNFNNNN)NTNrfNNF) NTNrfNNNFN)NTNNF)NNréFFNNN)NFNN)NNFNrs)NFN)DrwrxryrzÚdelimÚsetÚ capabilitiesr r€r†r„r\rFrŒrr‘r•r—r™rœržr r¢r¤r©rªr¬r°r³r¶r¸r»r½r¿rÁrÅrÇrÈrËrÍrŠrÎrÓrÖr×rØrÛrÜrÞrãrçrêrõrørúrûrrrr r rrrrrrrr r r r rósæ þ1   ÿ         ÿ ÿ ÿ  ÿ  ÿ  ÿ ÿ  ÿ ÿ  ÿ  ÿ þ þ ÿ  ý ÿ   ÿ   ÿ   ÿ   ÿ   ÿrc@sŠeZdZdZejZd dd„Zdd„Zdd„Z d d „Z d d „Z d d„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zd!dd„ZdS)"ÚFileStorageUrizã StorageUri subclass that handles files in the local file system. Callers should instantiate this class by calling boto.storage_uri(). See file/README about how we map StorageUri operations onto a file system. FcCs,d|_d|_||_d||_||_||_dS)a™Instantiate a FileStorageUri from a path name. @type object_name: string @param object_name: object name @type debug: boolean @param debug: whether to enable debugging on this StorageUri After instantiation the components are available in the following fields: uri, scheme, bucket_name (always blank for this "anonymous" bucket), object_name. r1rNzfile://N)r8rr!r r=Ústream)rr!r=rÇr r r r ^s    zFileStorageUri.__init__cCst||j|jƒS)z¶Instantiate a FileStorageUri from the current FileStorageUri, but replacing the object_name. @type new_name: string @param new_name: new object name )rr=r rr r r rŒrsz!FileStorageUri.clone_replace_namecCr®)r¯Tr rr r r r°{r±zFileStorageUri.is_file_uricCr®)r²Fr rr r r r³r±zFileStorageUri.is_cloud_uricCrÂ)z5Returns True if this URI names a directory or bucket.)r»rr r r r¶ƒrÆzFileStorageUri.names_containercCs | ¡ S)zs   Te