Package me.desair.tus.server.util
Class AbstractTusExtension
java.lang.Object
me.desair.tus.server.util.AbstractTusExtension
- All Implemented Interfaces:
TusExtension
- Direct Known Subclasses:
ChecksumExtension
,ConcatenationExtension
,CoreProtocol
,CreationExtension
,DownloadExtension
,ExpirationExtension
,TerminationExtension
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleError
(HttpMethod method, TusServletRequest request, TusServletResponse response, UploadStorageService uploadStorageService, String ownerKey) If a request is invalid, or when processing the request fails, it might be necessary to react to this failure.protected abstract void
initRequestHandlers
(List<RequestHandler> requestHandlers) protected abstract void
initValidators
(List<RequestValidator> requestValidators) 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 requestMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.desair.tus.server.TusExtension
getMinimalSupportedHttpMethods, getName
-
Constructor Details
-
AbstractTusExtension
public AbstractTusExtension()
-
-
Method Details
-
initValidators
-
initRequestHandlers
-
validate
public void validate(HttpMethod method, jakarta.servlet.http.HttpServletRequest servletRequest, UploadStorageService uploadStorageService, String ownerKey) throws TusException, IOException Description copied from interface:TusExtension
Validate the given request- Specified by:
validate
in interfaceTusExtension
- 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
public void process(HttpMethod method, TusServletRequest servletRequest, TusServletResponse servletResponse, UploadStorageService uploadStorageService, String ownerKey) throws IOException, TusException Description copied from interface:TusExtension
Process the given request- Specified by:
process
in interfaceTusExtension
- 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:
IOException
- When unable to read upload informationTusException
- When processing the request fails
-
handleError
public void handleError(HttpMethod method, TusServletRequest request, TusServletResponse response, UploadStorageService uploadStorageService, String ownerKey) throws IOException, TusException Description copied from interface:TusExtension
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.- Specified by:
handleError
in interfaceTusExtension
- Parameters:
method
- The HTTP method of this request (taking into account overrides)request
- The HTTP requestresponse
- The HTTP responseuploadStorageService
- The current upload storage serviceownerKey
- Identifier of the owner of this upload- Throws:
IOException
- When unable to read upload informationTusException
- When handling the error fails
-