Download destination¶
Note
Concrete classes described in this chapter implement methods defined in AbstractDownloadDestination
-
class
b2sdk.v1.
AbstractDownloadDestination
[source]¶ Interface to a destination for a downloaded file.
-
abstract
make_file_context
(file_id, file_name, content_length, content_type, content_sha1, file_info, mod_time_millis, range_=None)[source]¶ Return a context manager that yields a binary file-like object to use for writing the contents of the file.
- Parameters
file_id (str) – the B2 file ID from the headers
file_name (str) – the B2 file name from the headers
content_length (str) – the content length
content_type (str) – the content type from the headers
content_sha1 (str) – the content sha1 from the headers (or
"none"
for large files)file_info (dict) – the user file info from the headers
mod_time_millis (int) – the desired file modification date in ms since 1970-01-01
range (None,tuple[int,int]) – starting and ending offsets of the received file contents. Usually
None
, which means that the whole file is downloaded.
- Returns
None
-
abstract
-
class
b2sdk.v1.
DownloadDestLocalFile
[source]¶ Store a downloaded file into a local file and sets its modification time.
-
class
b2sdk.v1.
DownloadDestProgressWrapper
[source]¶ Wrap a DownloadDestination and report progress to a ProgressListener.