| webClient resp |
webClient := ZnClient new.
UIManager default informUserDuring: [ :bar |
������ bar label: 'Downloading resources for ' , self class printString.
������ [ webClient
������ ������ signalProgress: true;
������ ������ get: '
https://github.com/biosmalltalk/biopharo/raw/develop/test_files/BioSmalltalkTestFiles.zip' ]
������ on: HTTPProgress , ZnEntityTooLarge
������ do: [ : ex |
������ ������ (ex isKindOf: ZnEntityTooLarge)
������ ������ ������ ifTrue: [ ex resume ]
������ ������ ������ ifFalse: [
������ ������ ������ ������ | progress |
������ ������ ������ ������ progress := ex.
������ ������ ������ ������ progress isEmpty
������ ������ ������ ������ ������ ifFalse: [
������ ������ ������ ������ ������ ������ bar current: progress percentage.
������ ������ ������ ������ ������ ������ progress total ifNotNil: [ :aTotalNumber | bar label: 'Downloading ' ] ].
������ ������ ������ ������ progress resume ] ] ].
(resp := webClient response) isSuccess
������ ������ ifTrue: [ 'output2.zip' asFileReference writeStreamDo: [ : stream | stream nextPutAll: resp contents ] ]
������ ������ ifFalse: [ self error: 'Cannot download resource files' ].
I also tried using #writeOn: on the response, but that also wrote the response header:
self response writeOn: 'test1.zip' asFileReference writeStream.
self response writeOn: 'test2.zip' asFileReference binaryWriteStream.
PK ���� ���� �� D���������������������� ���� BioSmalltalkTestFiles/PK ����U?+*8!"�� K�� /���� BioSmalltalkTestFiles/A4A7DS6V01S-Alignment.xml��������ks�����H ����������� ���������� ����������� "���������_ �� ����: 0 R$`����jSS.,a�����