ApiDownloader

interface ApiDownloader

The downloader for accessing the-mod-index, or similarly structured indexes.

Author

ReviversMC

Since

1.0.0-2.0.0

Functions

Link copied to clipboard
abstract fun downloadIndexJson(): IndexJson?

Re-downloads and caches the IndexJson file from the remote repository. Null if the download fails.

Link copied to clipboard
abstract fun downloadManifestFileEntryFromHash(shortHash: String): List<VersionFile>

Retrieves the requested VersionFiles for the given sha512 shortHash. While extremely unlikely, there is a chance that the shortHash is not unique, and thus multiple VersionFiles will be returned. Should the shortHash be more than 15 characters, it will be truncated to the first 15 characters.

Link copied to clipboard
abstract fun downloadManifestFileEntryFromIdentifier(identifier: String): VersionFile?

Retrieves the requested VersionFile for the given identifier.

Link copied to clipboard
abstract fun downloadManifestJson(genericIdentifier: String): ManifestJson?

Retrieves the requested ManifestJson file for the given genericIdentifier. The format for a generic identifier is "modLoader:modName".

Link copied to clipboard
abstract fun downloadManifestJsonWithOverrides(genericIdentifier: String): ManifestJsonWithOverrides?

Retrieves the requested ManifestJsonWithOverrides file for the given genericIdentifier. The format for a generic identifier is "modLoader:modName".

Link copied to clipboard
abstract fun getOrDownloadIndexJson(): IndexJson?

Retrieves the IndexJson file from cache if it has already been downloaded, or attempts to download and cache it from the remote repository if no cache exists

Properties

Link copied to clipboard
abstract val cachedIndexJson: IndexJson?

Retrieves the IndexJson file from cache if it has already been downloaded, or null if no cache exists.

Link copied to clipboard
abstract val formattedBaseUrl: String

The base url the current instance of the ApiDownloader is targeting.

Inheritors

Link copied to clipboard