public interface UploadStorageService
| Modifier and Type | Method and Description |
|---|---|
UploadInfo |
append(UploadInfo upload,
InputStream inputStream)
Append the bytes in the give
InputStream to the upload with the given ID starting at the provided offset. |
void |
cleanupExpiredUploads(UploadLockingService uploadLockingService)
Clean up any upload data that is expired according to the configured expiration time
|
void |
copyUploadTo(UploadInfo info,
OutputStream outputStream)
Copy the uploaded bytes to the given output stream
|
UploadInfo |
create(UploadInfo info,
String ownerKey)
Create an upload location with the given upload information
|
long |
getMaxUploadSize()
Get the maximum upload size configured on this storage service
|
UploadConcatenationService |
getUploadConcatenationService()
Return the
UploadConcatenationService implementation that this upload service is using |
InputStream |
getUploadedBytes(String uploadURI,
String ownerKey)
Get the uploaded bytes corresponding to the given upload URL as a stream
|
InputStream |
getUploadedBytes(UploadId id)
Get the uploaded bytes corresponding to the given upload ID as a stream
|
Long |
getUploadExpirationPeriod()
Get the expiration period of an upload in milliseconds
|
UploadInfo |
getUploadInfo(String uploadUrl,
String ownerKey)
Method to retrieve the upload info by its upload URL
|
UploadInfo |
getUploadInfo(UploadId id)
Method to retrieve the upload info by its ID
|
String |
getUploadURI()
The URI which is configured as the upload endpoint
|
void |
removeLastNumberOfBytes(UploadInfo uploadInfo,
long byteCount)
Remove the given last amount of bytes from the uploaded data
|
void |
setIdFactory(UploadIdFactory idFactory)
Set an instance if IdFactory to be used for creating identities and extracting them from uploadURIs
|
void |
setMaxUploadSize(Long maxUploadSize)
Limit the maximum upload size to the given value
|
void |
setUploadConcatenationService(UploadConcatenationService concatenationService)
Set the
UploadConcatenationService that this upload storage service should use |
void |
setUploadExpirationPeriod(Long uploadExpirationPeriod)
Set the expiration period after which an in-progress upload expires
|
void |
terminateUpload(UploadInfo uploadInfo)
Terminate completed and unfinished uploads allowing the Server to free up used resources.
|
void |
update(UploadInfo uploadInfo)
Update the upload information for the provided ID.
|
UploadInfo getUploadInfo(String uploadUrl, String ownerKey) throws IOException
uploadUrl - The URL corresponding to this upload. This parameter can be null.ownerKey - A key representing the owner of the uploadIOExceptionUploadInfo getUploadInfo(UploadId id) throws IOException
id - The ID of the uploadIOException - When the service is not able to retrieve the upload informationString getUploadURI()
UploadInfo append(UploadInfo upload, InputStream inputStream) throws IOException, TusException
InputStream to the upload with the given ID starting at the provided offset.
This method also updates the UploadInfo corresponding to this upload. The Upload Storage server should
not exceed its max upload size when writing bytes.upload - The ID of the uploadinputStream - The input stream containing the bytes to appendUploadInfo for this uploadIOExceptionTusExceptionvoid setMaxUploadSize(Long maxUploadSize)
maxUploadSize - The maximum upload limit to setlong getMaxUploadSize()
UploadInfo create(UploadInfo info, String ownerKey) throws IOException
info - The Upload information to use to create the new uploadownerKey - A key representing the owner of the uploadUploadInfo object containing the information used to create the upload and its unique IDIOExceptionvoid update(UploadInfo uploadInfo) throws IOException, UploadNotFoundException
uploadInfo - The upload info object containing the ID and information to updateIOExceptionUploadNotFoundExceptionInputStream getUploadedBytes(String uploadURI, String ownerKey) throws IOException, UploadNotFoundException
uploadURI - The URIownerKey - The owner key of this uploadOutputStream containing the bytes of the uploadIOExceptionUploadNotFoundExceptionInputStream getUploadedBytes(UploadId id) throws IOException, UploadNotFoundException
id - the ID of the uploadOutputStream containing the bytes of the uploadIOException - When retrieving the bytes from the storage layer failsUploadNotFoundException - When the proved id is not linked to an uploadvoid copyUploadTo(UploadInfo info, OutputStream outputStream) throws UploadNotFoundException, IOException
info - The upload of which we should copy the bytesoutputStream - The output stream where we have to copy the bytes toUploadNotFoundExceptionIOExceptionvoid cleanupExpiredUploads(UploadLockingService uploadLockingService) throws IOException
uploadLockingService - An UploadLockingService that can be used to check and lock uploadsIOExceptionvoid removeLastNumberOfBytes(UploadInfo uploadInfo, long byteCount) throws UploadNotFoundException, IOException
uploadInfo - Upload of which to remove the bytesbyteCount - The number of bytes to remove at the endUploadNotFoundExceptionIOExceptionvoid terminateUpload(UploadInfo uploadInfo) throws UploadNotFoundException, IOException
uploadInfo - The upload to terminateUploadNotFoundExceptionIOExceptionLong getUploadExpirationPeriod()
void setUploadExpirationPeriod(Long uploadExpirationPeriod)
uploadExpirationPeriod - The period in millisecondsvoid setUploadConcatenationService(UploadConcatenationService concatenationService)
UploadConcatenationService that this upload storage service should useconcatenationService - The UploadConcatenationService implementation to useUploadConcatenationService getUploadConcatenationService()
UploadConcatenationService implementation that this upload service is usingvoid setIdFactory(UploadIdFactory idFactory)
idFactory - The UploadIdFactory to use within this storage serviceCopyright © 2019. All rights reserved.