Interface VersionManifestRepository


  • public interface VersionManifestRepository
    A repository resolving version manifests.
    • 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.IOException
        Inject 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 a VersionDescriptor.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.IOException
        Inject a pre-existing local version descriptor.
        Parameters:
        localDescriptor - the local file containing the JSON representation of a VersionDescriptor.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 VersionDescriptor not obtained from this repository.

        Parameters:
        unknown - a version descriptor of unknown type
        Returns:
        a full version