Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
stream.write(file.content)
file.content = None
# If the file is small, the download is complete at this point.
# If file size is large, download the rest of the blob in chunks.
if file.properties.content_length != download_size:
# At this point we would like to lock on something like the etag so that
# if the file is modified, we do not get a corrupted download. However,
# this feature is not yet available on the file service.
end_file = file_size
if end_range is not None:
# Use the end_range unless it is over the end of the file
end_file = min(file_size, end_range + 1)
_download_file_chunks(
self,
share_name,
directory_name,
file_name,
download_size,
self.MAX_CHUNK_GET_SIZE,
first_get_size,
initial_request_end + 1, # start where the first download ended
end_file,
stream,
max_connections,
progress_callback,
validate_content,
timeout,
operation_context,
snapshot