Utilities for downloading compressed repositories.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2020-08-13 19:11:56 -05:00
parent bb78aceda1
commit 6d90259387

View File

@ -124,6 +124,23 @@ FossilRepo >> createPage: pageName [
^ NeoJSONReader fromString: (self jsonWikiDataFor: 'create/', pageName)
]
{ #category : #operation }
FossilRepo >> downloadZippedInto: aFolder [
| zippedFileName zippedFile |
self remote ifNil: [ ^ self ].
zippedFileName := self remoteName , '.zip'.
zippedFile := FileLocator temp / zippedFileName.
GrafoscopioUtils
downloadingFrom: self remote / 'zip'
withMessage: 'Downloading zipped repository...'
into: aFolder.
aFolder / 'zip' renameTo: zippedFileName.
^ zippedFile
]
{ #category : #wiki }
FossilRepo >> fetchPage: pageName [
^ NeoJSONReader fromString: (self jsonWikiDataFor: 'get/', pageName)
@ -275,6 +292,12 @@ FossilRepo >> remote: anUrlString [
remote := anUrlString asUrl
]
{ #category : #utilities }
FossilRepo >> remoteName [
self remote ifNil: [ ^ self ].
^ self remote asUrl segments last
]
{ #category : #utilities }
FossilRepo >> sanitize: aFileNameWithRelativePath [
"I dicern if my argument concerns to a versioned or an unversioned file,