Class ArtifactLoader

java.lang.Object
de.craftsblock.craftsnet.addon.artifacts.ArtifactLoader

public final class ArtifactLoader extends Object
The ArtifactLoader class provides functionality for resolving and loading libraries (artifacts) for addons in a modular system.
Since:
3.0.0-SNAPSHOT
See Also:
  • Constructor Details

    • ArtifactLoader

      public ArtifactLoader()
      Creates a new instance of the artifact loader
  • Method Details

    • cleanup

      public void cleanup()
      Cleanup internal repository cache
    • stop

      public void stop()
      Cleanup and shutdown of the internal repository resolver
    • addRepository

      public void addRepository(String repo)
      Adds a remote repository to the list of repositories used for dependency resolution.
      Parameters:
      repo - The URL of the remote repository to be added.
    • loadLibraries

      public URL[] loadLibraries(CraftsNet craftsNet, AddonLoader addonLoader, Collection<RegisteredService> services, String addon, String... libraries)
      Loads libraries for a specific addon based on the provided library coordinates.
      Parameters:
      craftsNet - The CraftsNet instance that loads the libraries.
      addonLoader - The addon loader responsible for loading services.
      services - The list with the currently registered services.
      addon - The name of the addon for which libraries are being loaded.
      libraries - The coordinates of the libraries to be loaded.
      Returns:
      An array of URLs representing the loaded libraries.