Interface DownloadManager

All Superinterfaces:
Manager
All Known Implementing Classes:
DisabledDownloader, Downloader

public interface DownloadManager extends Manager

DownloadManager

This interface represents a manager, that controls web server for downloading players worlds with /world download.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all archives from temporary folder.
    void
    clearArchives(@NotNull Planet planet)
    Removes saved archives of planet, because it was unloaded.
    @NotNull File
    compressPlanetToArchive(@NotNull Planet planet, @NotNull DownloadSession session)
    Compresses planet folders to one archive.
    void
    Shutdowns web world downloader server.
    uploadPlanet(@NotNull Planet planet, @NotNull org.bukkit.entity.Player player)
    Compresses planet folders to archive in temporary folder, then generates unique token and returns link to download world.

    Methods inherited from interface Manager

    getName, init, isEnabled
    Modifier and Type
    Method
    Description
    Returns name of manager, that will be displayed by request in the logs.
    void
    Initialization of manager.
    boolean
    Checks if manager is ready to work.
  • Method Details

    • uploadPlanet

      @NotNull @NotNull CompletableFuture<String> uploadPlanet(@NotNull @NotNull Planet planet, @NotNull @NotNull org.bukkit.entity.Player player)
      Compresses planet folders to archive in temporary folder, then generates unique token and returns link to download world.
      Parameters:
      planet - planet, that was requested to download.
      player - player, who requested.
      Returns:
      string of link.
    • compressPlanetToArchive

      @NotNull @NotNull File compressPlanetToArchive(@NotNull @NotNull Planet planet, @NotNull @NotNull DownloadSession session)
      Compresses planet folders to one archive.
      Parameters:
      planet - planet to compress folders.
      session - download session.
      Returns:
      compressed archive.
    • clearArchives

      void clearArchives(@NotNull @NotNull Planet planet)
      Removes saved archives of planet, because it was unloaded.
      Parameters:
      planet - planet to remove archive.
    • clearAllArchives

      void clearAllArchives()
      Clears all archives from temporary folder.
    • shutdown

      void shutdown()
      Shutdowns web world downloader server.