Interface DownloadManager

All Superinterfaces:
Manager, ShutDownable, Startable, Toggleable
All Known Implementing Classes:
DisabledDownloader, Downloader

public interface DownloadManager extends Manager, Toggleable

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 ua.mcchickenstudio.opencreative.managers.Manager

    getName

    Methods inherited from interface ua.mcchickenstudio.opencreative.managers.Startable

    start

    Methods inherited from interface ua.mcchickenstudio.opencreative.managers.Toggleable

    isWorking
  • 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.
      Specified by:
      shutdown in interface ShutDownable