Class FileUpload

java.lang.Object
net.minecraft.client.realms.FileUpload

@Environment(CLIENT)
public class FileUpload
extends Object
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • file

      private final File file
    • worldId

      private final long worldId
    • slotId

      private final int slotId
    • uploadInfo

      private final UploadInfo uploadInfo
    • sessionId

      private final String sessionId
    • username

      private final String username
    • clientVersion

      private final String clientVersion
    • uploadStatus

      private final UploadStatus uploadStatus
    • cancelled

      private final AtomicBoolean cancelled
    • uploadTask

      private CompletableFuture<UploadResult> uploadTask
    • requestConfig

      private final org.apache.http.client.config.RequestConfig requestConfig
  • Constructor Details

  • Method Details

    • upload

      public void upload​(Consumer<UploadResult> callback)
    • cancel

      public void cancel()
    • requestUpload

      private UploadResult requestUpload​(int currentAttempt)
    • cleanup

      private void cleanup​(org.apache.http.client.methods.HttpPost request, org.apache.http.impl.client.CloseableHttpClient client)
    • setupRequest

      private void setupRequest​(org.apache.http.client.methods.HttpPost request) throws FileNotFoundException
      Throws:
      FileNotFoundException
    • handleResponse

      private void handleResponse​(org.apache.http.HttpResponse response, UploadResult.Builder uploadResultBuilder) throws IOException
      Throws:
      IOException
    • shouldRetry

      private boolean shouldRetry​(long retryDelaySeconds, int currentAttempt)
    • retryUploadAfter

      private UploadResult retryUploadAfter​(long retryDelaySeconds, int currentAttempt) throws InterruptedException
      Throws:
      InterruptedException
    • getRetryDelaySeconds

      private long getRetryDelaySeconds​(org.apache.http.HttpResponse response)
    • isFinished

      public boolean isFinished()