Class MultipartDownloadResumeContext
- java.lang.Object
-
- software.amazon.awssdk.services.s3.internal.multipart.MultipartDownloadResumeContext
-
public class MultipartDownloadResumeContext extends Object
This class keep tracks of the state of a multipart download across multipart GET requests.
-
-
Constructor Summary
Constructors Constructor Description MultipartDownloadResumeContext()
MultipartDownloadResumeContext(Collection<Integer> completedParts, Long bytesToLastCompletedParts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCompletedPart(int partNumber)
void
addToBytesToLastCompletedParts(long bytes)
Long
bytesToLastCompletedParts()
List<Integer>
completedParts()
int
highestSequentialCompletedPart()
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.GetObjectResponse
response()
void
response(GetObjectResponse response)
String
toString()
Integer
totalParts()
void
totalParts(int totalParts)
-
-
-
Constructor Detail
-
MultipartDownloadResumeContext
public MultipartDownloadResumeContext()
-
MultipartDownloadResumeContext
public MultipartDownloadResumeContext(Collection<Integer> completedParts, Long bytesToLastCompletedParts)
-
-
Method Detail
-
bytesToLastCompletedParts
public Long bytesToLastCompletedParts()
-
addCompletedPart
public void addCompletedPart(int partNumber)
-
addToBytesToLastCompletedParts
public void addToBytesToLastCompletedParts(long bytes)
-
totalParts
public void totalParts(int totalParts)
-
totalParts
public Integer totalParts()
-
response
public GetObjectResponse response()
-
response
public void response(GetObjectResponse 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.
-
-