Class VirtualConcatenationService
java.lang.Object
me.desair.tus.server.upload.concatenation.VirtualConcatenationService
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetConcatenatedBytes
(UploadInfo uploadInfo) Get the concatenated bytes of this concatenated uploadgetPartialUploads
(UploadInfo info) Get all underlying partial uploads associated with the given concatenated uploadvoid
merge
(UploadInfo uploadInfo) Merge the given concatenated upload if all the underlying partial uploads are completed.
-
Constructor Details
-
VirtualConcatenationService
-
-
Method Details
-
merge
Description copied from interface:UploadConcatenationService
Merge the given concatenated upload if all the underlying partial uploads are completed. If the underlying partial uploads are still in-progress, this method does nothing. Otherwise the upload information of the concatenated upload is updated.- Specified by:
merge
in interfaceUploadConcatenationService
- Parameters:
uploadInfo
- The concatenated upload- Throws:
IOException
- If merging the upload failsUploadNotFoundException
- When one of the partial uploads cannot be found
-
getConcatenatedBytes
public InputStream getConcatenatedBytes(UploadInfo uploadInfo) throws IOException, UploadNotFoundException Description copied from interface:UploadConcatenationService
Get the concatenated bytes of this concatenated upload- Specified by:
getConcatenatedBytes
in interfaceUploadConcatenationService
- Parameters:
uploadInfo
- The concatenated upload- Returns:
- The concatenated bytes, or null if this upload is still in progress
- Throws:
IOException
- When return the concatenated bytes failsUploadNotFoundException
- When the or one of the partial uploads cannot be found
-
getPartialUploads
public List<UploadInfo> getPartialUploads(UploadInfo info) throws IOException, UploadNotFoundException Description copied from interface:UploadConcatenationService
Get all underlying partial uploads associated with the given concatenated upload- Specified by:
getPartialUploads
in interfaceUploadConcatenationService
- Parameters:
info
- The concatenated upload- Returns:
- The underlying partial uploads
- Throws:
IOException
- When retrieving the underlying partial uploads failsUploadNotFoundException
- When one of the partial uploads cannot be found
-