Package com.mojang.realmsclient.client
Class FileUpload
java.lang.Object
com.mojang.realmsclient.client.FileUpload
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final AtomicBoolean
private final String
private final File
private static final org.apache.logging.log4j.Logger
private final org.apache.http.client.config.RequestConfig
private final String
private final int
private final UploadInfo
private final UploadStatus
private CompletableFuture<UploadResult>
private final String
private final long
-
Constructor Summary
ConstructorDescriptionFileUpload
(File p_i232194_1_, long p_i232194_2_, int p_i232194_4_, UploadInfo p_i232194_5_, Session p_i232194_6_, String p_i232194_7_, UploadStatus p_i232194_8_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
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
(Consumer<UploadResult> p_224874_1_)
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
file
-
worldId
private final long worldId -
slotId
private final int slotId -
uploadInfo
-
sessionId
-
username
-
clientVersion
-
uploadStatus
-
cancelled
-
uploadTask
-
requestConfig
private final org.apache.http.client.config.RequestConfig requestConfig
-
-
Constructor Details
-
FileUpload
public FileUpload(File p_i232194_1_, long p_i232194_2_, int p_i232194_4_, UploadInfo p_i232194_5_, Session p_i232194_6_, String p_i232194_7_, UploadStatus p_i232194_8_)
-
-
Method Details
-
upload
-
cancel
public void cancel() -
requestUpload
-
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 FileNotFoundException - Throws:
FileNotFoundException
-
handleResponse
private void handleResponse(org.apache.http.HttpResponse p_224875_1_, UploadResult.Builder p_224875_2_) throws IOException - Throws:
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 InterruptedException - Throws:
InterruptedException
-
getRetryDelaySeconds
private long getRetryDelaySeconds(org.apache.http.HttpResponse p_224880_1_) -
isFinished
public boolean isFinished()
-