Interface VersionManifestRepository
-
public interface VersionManifestRepositoryA repository resolving version manifests.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.util.List<? extends VersionDescriptor>>availableVersions()Get all available versions.static VersionManifestRepositoryfromDownloader(org.spongepowered.gradle.vanilla.resolver.Downloader downloader)Create a repository that will fetch version manifests from the API endpoint.java.util.concurrent.CompletableFuture<org.spongepowered.gradle.vanilla.resolver.ResolutionResult<VersionDescriptor.Full>>fullVersion(java.lang.String versionId)Query a full version for a specific id.default java.lang.Stringinject(java.io.File localDescriptor)Inject a pre-existing local version descriptor.java.lang.Stringinject(java.nio.file.Path localDescriptor)Inject a pre-existing local version descriptor.java.util.concurrent.CompletableFuture<java.util.Optional<java.lang.String>>latestVersion(VersionClassifier classifier)Get the identifier for the latest version of a particular type.java.util.concurrent.CompletableFuture<VersionManifestV2>manifest()Fetch the backing manifest.default java.util.concurrent.CompletableFuture<VersionDescriptor.Full>promote(VersionDescriptor unknown)Promote a reference to a full version description.
-
-
-
Method Detail
-
fromDownloader
static VersionManifestRepository fromDownloader(org.spongepowered.gradle.vanilla.resolver.Downloader downloader)
Create a repository that will fetch version manifests from the API endpoint.This repository will cache information based on the parameters of the provided downloader.
- Parameters:
downloader- the downloader to use to fetch remote resources- Returns:
- a new downloader-based repository
-
manifest
java.util.concurrent.CompletableFuture<VersionManifestV2> manifest()
Fetch the backing manifest.- Returns:
- the backing manifest
-
availableVersions
java.util.concurrent.CompletableFuture<java.util.List<? extends VersionDescriptor>> availableVersions()
Get all available versions.- Returns:
- the collection of available versions
-
latestVersion
java.util.concurrent.CompletableFuture<java.util.Optional<java.lang.String>> latestVersion(VersionClassifier classifier)
Get the identifier for the latest version of a particular type.- Parameters:
classifier- the version classifier to query the latest version of.- Returns:
- a version id if any is present for the classifier
-
fullVersion
java.util.concurrent.CompletableFuture<org.spongepowered.gradle.vanilla.resolver.ResolutionResult<VersionDescriptor.Full>> fullVersion(java.lang.String versionId)
Query a full version for a specific id.- Parameters:
versionId- the ID of the version to query- Returns:
- a version descriptor
-
inject
java.lang.String inject(java.nio.file.Path localDescriptor) throws java.io.IOExceptionInject a pre-existing local version descriptor.This can be used to target out-of-band releases not available via the normal metadata API.
Injected versions will not be tracked by any caching storage that a repository may implement, but must be stored in-memory. To continue making an injected version available, it must be provided on every run.
- Parameters:
localDescriptor- the local file containing the JSON representation of aVersionDescriptor.Full- Returns:
- the
VersionDescriptor.id()of the loaded version - Throws:
java.io.IOException- any errors that occur loading the descriptor.
-
inject
default java.lang.String inject(java.io.File localDescriptor) throws java.io.IOExceptionInject a pre-existing local version descriptor.- Parameters:
localDescriptor- the local file containing the JSON representation of aVersionDescriptor.Full- Returns:
- the
VersionDescriptor.id()of the loaded version - Throws:
java.io.IOException- if any errors occur while attempting to load the descriptor.- See Also:
for more details
-
promote
default java.util.concurrent.CompletableFuture<VersionDescriptor.Full> promote(VersionDescriptor unknown)
Promote a reference to a full version description.If the passed descriptor is a reference, a network lookup may occur to resolve a full descriptor.
Behaviour is undefined when attempting to fetch a result for a
VersionDescriptornot obtained from this repository.- Parameters:
unknown- a version descriptor of unknown type- Returns:
- a full version
-
-