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.slf4j.Logger
private static final int
private final long
private final org.apache.http.client.config.RequestConfig
private final String
private final int
private static final String
private final UploadInfo
private final UploadStatus
private CompletableFuture
<UploadResult> private final String
private final String
-
Constructor Summary
ConstructorDescriptionFileUpload
(File p_87071_, long p_87072_, int p_87073_, UploadInfo p_87074_, User p_87075_, String p_87076_, String p_325917_, UploadStatus p_87077_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
private void
cleanup
(org.apache.http.client.methods.HttpPost p_87094_, org.apache.http.impl.client.CloseableHttpClient p_87095_) private long
getRetryDelaySeconds
(org.apache.http.HttpResponse p_87087_) private void
handleResponse
(org.apache.http.HttpResponse p_87089_, UploadResult.Builder p_87090_) boolean
private UploadResult
requestUpload
(int p_87080_) private UploadResult
retryUploadAfter
(long p_87098_, int p_87099_) private void
setupRequest
(org.apache.http.client.methods.HttpPost p_87092_) private boolean
shouldRetry
(long p_87082_, int p_87083_) void
upload
(Consumer<UploadResult> p_87085_)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MAX_RETRIES
private static final int MAX_RETRIES- See Also:
-
UPLOAD_PATH
- See Also:
-
file
-
realmId
private final long realmId -
slotId
private final int slotId -
uploadInfo
-
sessionId
-
username
-
clientVersion
-
worldVersion
-
uploadStatus
-
cancelled
-
uploadTask
-
requestConfig
private final org.apache.http.client.config.RequestConfig requestConfig
-
-
Constructor Details
-
FileUpload
public FileUpload(File p_87071_, long p_87072_, int p_87073_, UploadInfo p_87074_, User p_87075_, String p_87076_, String p_325917_, UploadStatus p_87077_)
-
-
Method Details
-
upload
-
cancel
public void cancel() -
requestUpload
-
cleanup
private void cleanup(org.apache.http.client.methods.HttpPost p_87094_, @Nullable org.apache.http.impl.client.CloseableHttpClient p_87095_) -
setupRequest
private void setupRequest(org.apache.http.client.methods.HttpPost p_87092_) throws FileNotFoundException - Throws:
FileNotFoundException
-
handleResponse
private void handleResponse(org.apache.http.HttpResponse p_87089_, UploadResult.Builder p_87090_) throws IOException - Throws:
IOException
-
shouldRetry
private boolean shouldRetry(long p_87082_, int p_87083_) -
retryUploadAfter
- Throws:
InterruptedException
-
getRetryDelaySeconds
private long getRetryDelaySeconds(org.apache.http.HttpResponse p_87087_) -
isFinished
public boolean isFinished()
-