Package me.desair.tus.server
Interface TusExtension
- All Known Implementing Classes:
AbstractTusExtension
,ChecksumExtension
,ConcatenationExtension
,CoreProtocol
,CreationExtension
,DownloadExtension
,ExpirationExtension
,TerminationExtension
public interface TusExtension
Interface that represents an extension in the tus protocol
-
Method Summary
Modifier and TypeMethodDescriptionThe minimal list of HTTP methods that this extension needs to function properlygetName()
The name of the Tus extension that can be used to disable or enable the extensionvoid
handleError
(HttpMethod method, TusServletRequest servletRequest, TusServletResponse servletResponse, UploadStorageService uploadStorageService, String ownerKey) If a request is invalid, or when processing the request fails, it might be necessary to react to this failure.void
process
(HttpMethod method, TusServletRequest servletRequest, TusServletResponse servletResponse, UploadStorageService uploadStorageService, String ownerKey) Process the given requestvoid
validate
(HttpMethod method, jakarta.servlet.http.HttpServletRequest servletRequest, UploadStorageService uploadStorageService, String ownerKey) Validate the given request
-
Method Details
-
getName
String getName()The name of the Tus extension that can be used to disable or enable the extension- Returns:
- The name of the extension
-
validate
void validate(HttpMethod method, jakarta.servlet.http.HttpServletRequest servletRequest, UploadStorageService uploadStorageService, String ownerKey) throws TusException, IOException Validate the given request- Parameters:
method
- The HTTP method of this request (taking into account overrides)servletRequest
- The HTTP requestuploadStorageService
- The current upload storage serviceownerKey
- Identifier of the owner of this upload- Throws:
TusException
- When the request is invalidIOException
- When unable to read upload information
-
process
void process(HttpMethod method, TusServletRequest servletRequest, TusServletResponse servletResponse, UploadStorageService uploadStorageService, String ownerKey) throws IOException, TusException Process the given request- Parameters:
method
- The HTTP method of this request (taking into account overrides)servletRequest
- The HTTP requestservletResponse
- The HTTP responseuploadStorageService
- The current upload storage serviceownerKey
- Identifier of the owner of this upload- Throws:
TusException
- When processing the request failsIOException
- When unable to read upload information
-
handleError
void handleError(HttpMethod method, TusServletRequest servletRequest, TusServletResponse servletResponse, UploadStorageService uploadStorageService, String ownerKey) throws IOException, TusException If a request is invalid, or when processing the request fails, it might be necessary to react to this failure. This method allows extensions to react to validation or processing failures.- Parameters:
method
- The HTTP method of this request (taking into account overrides)servletRequest
- The HTTP requestservletResponse
- The HTTP responseuploadStorageService
- The current upload storage serviceownerKey
- Identifier of the owner of this upload- Throws:
TusException
- When handling the error failsIOException
- When unable to read upload information
-
getMinimalSupportedHttpMethods
Collection<HttpMethod> getMinimalSupportedHttpMethods()The minimal list of HTTP methods that this extension needs to function properly- Returns:
- The list of HTTP methods required by this extension
-