public class VirtualConcatenationService extends Object implements UploadConcatenationService
UploadConcatenationService implementation that uses the file system to keep track
of concatenated uploads. The concatenation is executed "virtually" meaning that upload bytes
are not duplicated to the upload but "concatenated" on the fly.| Constructor and Description |
|---|
VirtualConcatenationService(UploadStorageService uploadStorageService) |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getConcatenatedBytes(UploadInfo uploadInfo)
Get the concatenated bytes of this concatenated upload
|
List<UploadInfo> |
getPartialUploads(UploadInfo info)
Get all underlying partial uploads associated with the given concatenated upload
|
void |
merge(UploadInfo uploadInfo)
Merge the given concatenated upload if all the underlying partial uploads are completed.
|
public VirtualConcatenationService(UploadStorageService uploadStorageService)
public void merge(UploadInfo uploadInfo) throws IOException, UploadNotFoundException
UploadConcatenationServicemerge in interface UploadConcatenationServiceuploadInfo - The concatenated uploadIOException - If merging the upload failsUploadNotFoundException - When one of the partial uploads cannot be foundpublic InputStream getConcatenatedBytes(UploadInfo uploadInfo) throws IOException, UploadNotFoundException
UploadConcatenationServicegetConcatenatedBytes in interface UploadConcatenationServiceuploadInfo - The concatenated uploadIOException - When return the concatenated bytes failsUploadNotFoundException - When the or one of the partial uploads cannot be foundpublic List<UploadInfo> getPartialUploads(UploadInfo info) throws IOException, UploadNotFoundException
UploadConcatenationServicegetPartialUploads in interface UploadConcatenationServiceinfo - The concatenated uploadIOException - When retrieving the underlying partial uploads failsUploadNotFoundException - When one of the partial uploads cannot be foundCopyright © 2023. All rights reserved.