Class PluginInstallUtils.StagingCatalogue
- All Implemented Interfaces:
ModuleFileTransactions.Catalogue,ModuleFileTransactions.Downloader
- Enclosing class:
PluginInstallUtils
The catalogue contract makes a download.url an opaque address: it must not be built
or parsed, and its shape may change inside a contract version. So the download is verified
against the version this staging has just read through the contract's version route (the
module's identifier and the version, CatalogueClient.version(String, String)), which is
also where its link came from, and never against a route derived from the URL. A link this
staging did not just obtain from the catalogue is not downloaded.
One instance serves one call of ModuleFileTransactions.stageUpdate(java.lang.String, java.util.List<com.ultikits.ultitools.abstracts.UltiToolsPlugin>, java.util.function.Function<com.ultikits.ultitools.abstracts.UltiToolsPlugin, java.io.File>, com.ultikits.ultitools.utils.ModuleFileTransactions.Catalogue, com.ultikits.ultitools.utils.ModuleFileTransactions.Downloader), which asks for
the link and then downloads it on the same thread; it is not shared.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
resolved
-
resolvedLink
-
-
Constructor Details
-
StagingCatalogue
StagingCatalogue()
-
-
Method Details
-
latestVersion
Description copied from interface:ModuleFileTransactions.CatalogueThe latest version of a module.- Specified by:
latestVersionin interfaceModuleFileTransactions.Catalogue- Parameters:
identifyString- the module's identify-string- Returns:
- the version, or
nullwhen there is none
-
downloadLink
Description copied from interface:ModuleFileTransactions.CatalogueThe download link of one version of a module.- Specified by:
downloadLinkin interfaceModuleFileTransactions.Catalogue- Parameters:
identifyString- the module's identify-stringversion- the version- Returns:
- the link, or
nullwhen there is none
-
download
Description copied from interface:ModuleFileTransactions.DownloaderDownloads a file.- Specified by:
downloadin interfaceModuleFileTransactions.Downloader- Parameters:
link- the linkfileName- the file name to writefolder- the folder to write it into- Throws:
IOException- when the download fails
-