Class DownloadSession
java.lang.Object
ua.mcchickenstudio.opencreative.managers.downloader.DownloadSession
DownloadSession
This class represents a session of downloading a planet.-
Constructor Summary
ConstructorsConstructorDescriptionDownloadSession(int planetID, @NotNull String playerName) Creates download session with specified planet ID, and randomly generated token. -
Method Summary
Modifier and TypeMethodDescription@Nullable FileReturns archive with planet folders.intReturns ID of planet, that was requested to create an archive.@NotNull StringReturns player name, who wants to download a world.@NotNull StringReturns token, that gives access to download the planet.booleanChecks whether session should be removed, because it was created too many seconds ago.voidsetArchive(@NotNull File archive) Sets compressed archive with planet folders.
-
Constructor Details
-
DownloadSession
Creates download session with specified planet ID, and randomly generated token.- Parameters:
planetID- id of planet, that was requested to create an archive.
-
-
Method Details
-
isExpired
public boolean isExpired()Checks whether session should be removed, because it was created too many seconds ago.- Returns:
- true - should be removed, false - not yet.
-
getPlayer
Returns player name, who wants to download a world.- Returns:
- name of player.
-
setArchive
Sets compressed archive with planet folders.- Parameters:
archive- archive with planet folders.
-
getArchive
Returns archive with planet folders.- Returns:
- compressed archive with planet folders, or null - if not exists yet.
-
getPlanetID
public int getPlanetID()Returns ID of planet, that was requested to create an archive.- Returns:
- id of associated planet.
-
getSecretToken
Returns token, that gives access to download the planet.- Returns:
- secret token.
-