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 AtomicBoolean
private String
private File
private static org.apache.logging.log4j.Logger
private static int
private org.apache.http.client.config.RequestConfig
private String
private int
private static String
private UploadInfo
private UploadStatus
private CompletableFuture<UploadResult>
private String
private long
-
Constructor Summary
ConstructorDescriptionFileUpload(File p_87071_, long p_87072_, int p_87073_, UploadInfo p_87074_, User p_87075_, String p_87076_, 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.apache.logging.log4j.Logger LOGGER -
MAX_RETRIES
private static final int MAX_RETRIES- See Also:
- Constant Field Values
-
UPLOAD_PATH
- See Also:
- Constant Field Values
-
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_87071_, long p_87072_, int p_87073_, UploadInfo p_87074_, User p_87075_, String p_87076_, UploadStatus p_87077_)
-
-
Method Details
-
upload
-
cancel
public void cancel() -
requestUpload
-
cleanup
private void cleanup(org.apache.http.client.methods.HttpPost p_87094_, 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()
-