Class Downloader
java.lang.Object
ua.mcchickenstudio.opencreative.managers.downloader.Downloader
- All Implemented Interfaces:
DownloadManager, Manager
Downloader
This class represents a download manager, that will be used to compress and upload planet folders archive by using command: /world download.-
Constructor Summary
Constructors -
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.getName()Returns name of manager, that will be displayed by request in the logs.voidinit()Initialization of manager.booleanChecks if manager is ready to work.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.
-
Constructor Details
-
Downloader
public Downloader()
-
-
Method Details
-
uploadPlanet
@NotNull public @NotNull CompletableFuture<String> uploadPlanet(@NotNull @NotNull Planet planet, @NotNull @NotNull org.bukkit.entity.Player player) Description copied from interface:DownloadManagerCompresses planet folders to archive in temporary folder, then generates unique token and returns link to download world.- Specified by:
uploadPlanetin interfaceDownloadManager- Parameters:
planet- planet, that was requested to download.player- player, who requested.- Returns:
- string of link.
-
compressPlanetToArchive
@NotNull public @NotNull File compressPlanetToArchive(@NotNull @NotNull Planet planet, @NotNull @NotNull DownloadSession session) Description copied from interface:DownloadManagerCompresses planet folders to one archive.- Specified by:
compressPlanetToArchivein interfaceDownloadManager- Parameters:
planet- planet to compress folders.session- download session.- Returns:
- compressed archive.
-
clearArchives
Description copied from interface:DownloadManagerRemoves saved archives of planet, because it was unloaded.- Specified by:
clearArchivesin interfaceDownloadManager- Parameters:
planet- planet to remove archive.
-
clearAllArchives
public void clearAllArchives()Description copied from interface:DownloadManagerClears all archives from temporary folder.- Specified by:
clearAllArchivesin interfaceDownloadManager
-
init
-
shutdown
public void shutdown()Description copied from interface:DownloadManagerShutdowns web world downloader server.- Specified by:
shutdownin interfaceDownloadManager
-
isEnabled
-
getName
-