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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleError(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 voidinitRequestHandlers(List<RequestHandler> requestHandlers) protected abstract voidinitValidators(List<RequestValidator> requestValidators) voidprocess(HttpMethod method, TusServletRequest servletRequest, TusServletResponse servletResponse, UploadStorageService uploadStorageService, String ownerKey) Process the given requestvoidvalidate(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, waitMethods 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:TusExtensionValidate the given request- Specified by:
validatein 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:TusExtensionProcess the given request- Specified by:
processin 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:TusExtensionIf 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:
handleErrorin 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
-