Interface DownloadManager
- All Superinterfaces:
Manager, ShutDownable, Startable, Toggleable
- All Known Implementing Classes:
DisabledDownloader, Downloader
DownloadManager
This interface represents a manager, that controls web server for downloading players worlds with /world download.-
Method Summary
Modifier and TypeMethodDescriptionvoidClears all archives from temporary folder.voidclearArchives(@NotNull Planet planet) Removes saved archives of planet, because it was unloaded.@NotNull FilecompressPlanetToArchive(@NotNull Planet planet, @NotNull DownloadSession session) Compresses planet folders to one archive.voidshutdown()Shutdowns web world downloader server.@NotNull CompletableFuture<String> 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 Toggleable
isWorkingModifier and TypeMethodDescriptionbooleanChecks whether manager was started successfully and it currently works.
-
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
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:
shutdownin interfaceShutDownable
-