tlcurl.url_adapter_registry
¶
A list of registered UrlAdapters
Module Contents¶
Classes¶
Class |
Description |
---|---|
Maintains a list of currently registered UrlAdapters, and provides functionality for de-/serializing objects from Url. |
API¶
- class UrlAdapterRegistry¶
Maintains a list of currently registered UrlAdapters, and provides functionality for de-/serializing objects from Url.
- static register_url_adapter_for_scheme(
- scheme: Scheme,
- url_adapter: UrlAdapter,
Register a URL adapter to be used for the given scheme
- static register_url_adapter(
- url_adapter: UrlAdapter,
Register a URL adapter
- static get_url_adapter_for_url(
- url: Url,
- default_value: UrlAdapter | None = None,
Get the URL adapter for the given URL
- static get_url_adapter_for_scheme(
- scheme: Scheme,
- default_value: UrlAdapter | None = None,
Get URL adapter for the given scheme
- static read_string_content_from_url( ) str ¶
Resolve UrlAdapter and read the string content from the given URL
If no adapter can be resolved for the given Url return the ‘default_value’ if given else raise an exception
- static write_string_content_to_url(
- url: Url,
- content: str,
- options: IfExistsOption = IfExistsOption.OVERWRITE,
Resolve UrlAdapter and write the string content to the given URL
If no adapter can be resolved for the given Url an exception is raised
- static read_binary_content_from_url( ) bytes ¶
Resolve UrlAdapter and read the binary content from the given URL
If no adapter can be resolved for the given Url return the ‘default_value’ if given else raise an exception.
- static read_binary_content_from_url_async( ) Future ¶
Resolve UrlAdapter and read the binary content from the given URL
If no adapter can be resolved for the given Url return the ‘default_value’ if given else raise an exception.
- static write_binary_content_to_url(
- url: Url,
- content: bytes,
- options: IfExistsOption = IfExistsOption.OVERWRITE,
Resolve UrlAdapter and write the binary content to the given URL
If no adapter can be resolved for the given Url an exception is raised
- static write_binary_content_to_url_async(
- url: Url,
- content: bytes,
- options: IfExistsOption = IfExistsOption.OVERWRITE,
Resolve UrlAdapter and write the binary content to the given URL
If no adapter can be resolved for the given Url an exception is raised
- static copy_url(
- input: Url,
- output: Url,
- options: IfExistsOption = IfExistsOption.OVERWRITE,
Resolve UrlAdapter and copy the given URL
If no adapter can be resolved for the given Url an exception is raised
- static delete_url(
- url: Url,
Resolve UrlAdapter and delete the given URL
If no adapter can be resolved for the given Url an exception is raised
- static is_writable(
- url: Url,
Resolve UrlAdapter and check if the given URL is writable
If no adapter can be resolved for the given Url an exception is raised
- static make_dirs( ) None ¶
Resolve UrlAdapter and create a leaf directory and all intermediate ones at the given URL
If no adapter can be resolved for the given Url an exception is raised
- static is_file_hierarchy_flat(
- url: Url,
Resolve UrlAdapter and check if the given URL resides on storage with flat file hierarchy
If no adapter can be resolved for the given Url an exception is raised
- static get_file_size(
- url: Url,
Resolve UrlAdapter and get the size of the file at the given URL
If no adapter can be resolved for the given Url an exception is raised
- static list_dir(
- url: Url,
Resolve UrlAdapter and list the entries belonging to the directory at the given URL
If no adapter can be resolved for the given Url an exception is raised