Package com.mojang.realmsclient.client
Class FileUpload
- java.lang.Object
-
- com.mojang.realmsclient.client.FileUpload
-
public class FileUpload extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
FileUpload.CustomInputStreamEntity
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicBoolean
cancelled
private java.lang.String
clientVersion
private java.io.File
file
private static org.apache.logging.log4j.Logger
LOGGER
private org.apache.http.client.config.RequestConfig
requestConfig
private java.lang.String
sessionId
private int
slotId
private UploadInfo
uploadInfo
private UploadStatus
uploadStatus
private java.util.concurrent.CompletableFuture<UploadResult>
uploadTask
private java.lang.String
username
private long
worldId
-
Constructor Summary
Constructors Constructor Description FileUpload(java.io.File p_i232194_1_, long p_i232194_2_, int p_i232194_4_, UploadInfo p_i232194_5_, Session p_i232194_6_, java.lang.String p_i232194_7_, UploadStatus p_i232194_8_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
private void
cleanup(org.apache.http.client.methods.HttpPost p_224877_1_, org.apache.http.impl.client.CloseableHttpClient p_224877_2_)
private long
getRetryDelaySeconds(org.apache.http.HttpResponse p_224880_1_)
private void
handleResponse(org.apache.http.HttpResponse p_224875_1_, UploadResult.Builder p_224875_2_)
boolean
isFinished()
private UploadResult
requestUpload(int p_224879_1_)
private UploadResult
retryUploadAfter(long p_224876_1_, int p_224876_3_)
private void
setupRequest(org.apache.http.client.methods.HttpPost p_224872_1_)
private boolean
shouldRetry(long p_224882_1_, int p_224882_3_)
void
upload(java.util.function.Consumer<UploadResult> p_224874_1_)
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
file
private final java.io.File file
-
worldId
private final long worldId
-
slotId
private final int slotId
-
uploadInfo
private final UploadInfo uploadInfo
-
sessionId
private final java.lang.String sessionId
-
username
private final java.lang.String username
-
clientVersion
private final java.lang.String clientVersion
-
uploadStatus
private final UploadStatus uploadStatus
-
cancelled
private final java.util.concurrent.atomic.AtomicBoolean cancelled
-
uploadTask
private java.util.concurrent.CompletableFuture<UploadResult> uploadTask
-
requestConfig
private final org.apache.http.client.config.RequestConfig requestConfig
-
-
Constructor Detail
-
FileUpload
public FileUpload(java.io.File p_i232194_1_, long p_i232194_2_, int p_i232194_4_, UploadInfo p_i232194_5_, Session p_i232194_6_, java.lang.String p_i232194_7_, UploadStatus p_i232194_8_)
-
-
Method Detail
-
upload
public void upload(java.util.function.Consumer<UploadResult> p_224874_1_)
-
cancel
public void cancel()
-
requestUpload
private UploadResult requestUpload(int p_224879_1_)
-
cleanup
private void cleanup(org.apache.http.client.methods.HttpPost p_224877_1_, org.apache.http.impl.client.CloseableHttpClient p_224877_2_)
-
setupRequest
private void setupRequest(org.apache.http.client.methods.HttpPost p_224872_1_) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
handleResponse
private void handleResponse(org.apache.http.HttpResponse p_224875_1_, UploadResult.Builder p_224875_2_) throws java.io.IOException
- Throws:
java.io.IOException
-
shouldRetry
private boolean shouldRetry(long p_224882_1_, int p_224882_3_)
-
retryUploadAfter
private UploadResult retryUploadAfter(long p_224876_1_, int p_224876_3_) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
getRetryDelaySeconds
private long getRetryDelaySeconds(org.apache.http.HttpResponse p_224880_1_)
-
isFinished
public boolean isFinished()
-
-