Class MultipartDownloadResumeContext
java.lang.Object
software.amazon.awssdk.services.s3.internal.multipart.MultipartDownloadResumeContext
This class keep tracks of the state of a multipart download across multipart GET requests.
-
Constructor Summary
ConstructorsConstructorDescriptionMultipartDownloadResumeContext
(Collection<Integer> completedParts, Long bytesToLastCompletedParts) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCompletedPart
(int partNumber) void
addToBytesToLastCompletedParts
(long bytes) int
boolean
Check if the multipart download is complete or not by checking if the total amount of downloaded parts is equal to the total amount of parts.response()
void
response
(GetObjectResponse response) toString()
void
totalParts
(int totalParts)
-
Constructor Details
-
MultipartDownloadResumeContext
public MultipartDownloadResumeContext() -
MultipartDownloadResumeContext
public MultipartDownloadResumeContext(Collection<Integer> completedParts, Long bytesToLastCompletedParts)
-
-
Method Details
-
completedParts
-
bytesToLastCompletedParts
-
addCompletedPart
public void addCompletedPart(int partNumber) -
addToBytesToLastCompletedParts
public void addToBytesToLastCompletedParts(long bytes) -
totalParts
public void totalParts(int totalParts) -
totalParts
-
response
-
response
-
highestSequentialCompletedPart
public int highestSequentialCompletedPart()- Returns:
- the highest sequentially completed part, 0 means no parts completed. Used for non-sequential operation when parts may have been completed in a non-sequential order. For example, if parts [1, 2, 3, 6, 7, 10] were completed, this method will return 3.
-
isComplete
public boolean isComplete()Check if the multipart download is complete or not by checking if the total amount of downloaded parts is equal to the total amount of parts.- Returns:
- true if all parts were downloaded, false if not.
-
toString
-