Class DownloadSession

java.lang.Object
ua.mcchickenstudio.opencreative.managers.downloader.DownloadSession

public final class DownloadSession extends Object

DownloadSession

This class represents a session of downloading a planet.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DownloadSession(int planetID, @NotNull String playerName)
    Creates download session with specified planet ID, and randomly generated token.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable File
    Returns archive with planet folders.
    int
    Returns ID of planet, that was requested to create an archive.
    @NotNull String
    Returns player name, who wants to download a world.
    @NotNull String
    Returns token, that gives access to download the planet.
    boolean
    Checks whether session should be removed, because it was created too many seconds ago.
    void
    setArchive(@NotNull File archive)
    Sets compressed archive with planet folders.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DownloadSession

      public DownloadSession(int planetID, @NotNull @NotNull String playerName)
      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

      @NotNull public @NotNull String getPlayer()
      Returns player name, who wants to download a world.
      Returns:
      name of player.
    • setArchive

      public void setArchive(@NotNull @NotNull File archive)
      Sets compressed archive with planet folders.
      Parameters:
      archive - archive with planet folders.
    • getArchive

      @Nullable public @Nullable File 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

      @NotNull public @NotNull String getSecretToken()
      Returns token, that gives access to download the planet.
      Returns:
      secret token.