diff --git a/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st b/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st index 8578134..2fcec62 100644 --- a/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st +++ b/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st @@ -11,7 +11,7 @@ Class { { #category : #'graphical interface' } GrafoscopioUtils class >> downloadingFrom: downloadUrl withMessage: aString into: location [ | fileName | - fileName := downloadUrl segments last. + fileName := (self sanitize: downloadUrl) segments last. (location / fileName) ensureDelete. [: bar | bar title: aString. @@ -28,6 +28,24 @@ GrafoscopioUtils class >> downloadingFrom: downloadUrl withMessage: aString into ] asJob run. ] +{ #category : #'graphical interface' } +GrafoscopioUtils class >> getContentsFrom: url withMessage: aString [ + | client | + [: bar | + bar title: aString. + [client := ZnClient new + enforceHttpSuccess: true; + get: (url); + signalProgress: true + ] + on: HTTPProgress + do: [ :progress | + progress isEmpty ifFalse: [ bar current: progress percentage ]. + progress resume ]. + ] asJob run. + ^ client contents. +] + { #category : #private } GrafoscopioUtils class >> sanitize: url [ "I remove white spaces in url's and prepend 'http://' to urls when it is ommited, so